cfd-craft 0.1.0__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.
Files changed (51) hide show
  1. cfd_craft-0.1.0/Cargo.lock +367 -0
  2. cfd_craft-0.1.0/Cargo.toml +27 -0
  3. cfd_craft-0.1.0/LICENSE +21 -0
  4. cfd_craft-0.1.0/PKG-INFO +86 -0
  5. cfd_craft-0.1.0/bindings/python/Cargo.lock +401 -0
  6. cfd_craft-0.1.0/bindings/python/Cargo.toml +19 -0
  7. cfd_craft-0.1.0/bindings/python/build.rs +86 -0
  8. cfd_craft-0.1.0/bindings/python/src/lib.rs +167 -0
  9. cfd_craft-0.1.0/crates/cfd-craft/Cargo.toml +24 -0
  10. cfd_craft-0.1.0/crates/cfd-craft/LICENSE +21 -0
  11. cfd_craft-0.1.0/crates/cfd-craft/README.md +28 -0
  12. cfd_craft-0.1.0/crates/cfd-craft/build.rs +86 -0
  13. cfd_craft-0.1.0/crates/cfd-craft/examples/kernel_timing.rs +118 -0
  14. cfd_craft-0.1.0/crates/cfd-craft/examples/manual_archive.rs +26 -0
  15. cfd_craft-0.1.0/crates/cfd-craft/examples/manual_checkpoint.rs +67 -0
  16. cfd_craft-0.1.0/crates/cfd-craft/examples/manual_control.rs +47 -0
  17. cfd_craft-0.1.0/crates/cfd-craft/examples/manual_library.rs +51 -0
  18. cfd_craft-0.1.0/crates/cfd-craft/examples/performance_probe.rs +267 -0
  19. cfd_craft-0.1.0/crates/cfd-craft/examples/pressure_probe.rs +145 -0
  20. cfd_craft-0.1.0/crates/cfd-craft/src/case.rs +1783 -0
  21. cfd_craft-0.1.0/crates/cfd-craft/src/flow.rs +708 -0
  22. cfd_craft-0.1.0/crates/cfd-craft/src/grid.rs +634 -0
  23. cfd_craft-0.1.0/crates/cfd-craft/src/input.rs +154 -0
  24. cfd_craft-0.1.0/crates/cfd-craft/src/lib.rs +185 -0
  25. cfd_craft-0.1.0/crates/cfd-craft/src/momentum_solve.rs +654 -0
  26. cfd_craft-0.1.0/crates/cfd-craft/src/multigrid/line.rs +378 -0
  27. cfd_craft-0.1.0/crates/cfd-craft/src/multigrid.rs +977 -0
  28. cfd_craft-0.1.0/crates/cfd-craft/src/output.rs +336 -0
  29. cfd_craft-0.1.0/crates/cfd-craft/src/pressure.rs +795 -0
  30. cfd_craft-0.1.0/crates/cfd-craft/src/profiling.rs +335 -0
  31. cfd_craft-0.1.0/crates/cfd-craft/src/solver.rs +1385 -0
  32. cfd_craft-0.1.0/crates/cfd-craft/src/transport.rs +523 -0
  33. cfd_craft-0.1.0/crates/cfd-craft/src/turbulence_solve.rs +312 -0
  34. cfd_craft-0.1.0/crates/cfd-craft/src/verification.rs +36 -0
  35. cfd_craft-0.1.0/crates/cfd-craft/tests/implicit.rs +561 -0
  36. cfd_craft-0.1.0/crates/cfd-craft/tests/implicit_rans.rs +376 -0
  37. cfd_craft-0.1.0/crates/cfd-craft/tests/momentum.rs +655 -0
  38. cfd_craft-0.1.0/crates/cfd-craft/tests/multigrid.rs +360 -0
  39. cfd_craft-0.1.0/crates/cfd-craft/tests/numerics.rs +475 -0
  40. cfd_craft-0.1.0/crates/cfd-craft/tests/package_interface.rs +61 -0
  41. cfd_craft-0.1.0/crates/cfd-craft/tests/profiling.rs +103 -0
  42. cfd_craft-0.1.0/crates/cfd-craft/tests/regressions.rs +881 -0
  43. cfd_craft-0.1.0/crates/cfd-craft-cli/Cargo.toml +32 -0
  44. cfd_craft-0.1.0/crates/cfd-craft-cli/LICENSE +21 -0
  45. cfd_craft-0.1.0/crates/cfd-craft-cli/README.md +28 -0
  46. cfd_craft-0.1.0/crates/cfd-craft-cli/build.rs +86 -0
  47. cfd_craft-0.1.0/crates/cfd-craft-cli/src/main.rs +424 -0
  48. cfd_craft-0.1.0/pyproject.toml +43 -0
  49. cfd_craft-0.1.0/python/README.md +63 -0
  50. cfd_craft-0.1.0/python/cfd_craft/__init__.py +87 -0
  51. cfd_craft-0.1.0/python/cfd_craft/__main__.py +46 -0
@@ -0,0 +1,367 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "block-buffer"
7
+ version = "0.10.4"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
10
+ dependencies = [
11
+ "generic-array",
12
+ ]
13
+
14
+ [[package]]
15
+ name = "cfd-craft"
16
+ version = "0.1.0"
17
+ dependencies = [
18
+ "rayon",
19
+ "schemars",
20
+ "serde",
21
+ "serde_json",
22
+ "serde_path_to_error",
23
+ "sha2",
24
+ ]
25
+
26
+ [[package]]
27
+ name = "cfd-craft-cli"
28
+ version = "0.1.0"
29
+ dependencies = [
30
+ "cfd-craft",
31
+ "rayon",
32
+ "schemars",
33
+ "serde",
34
+ "serde_json",
35
+ "serde_path_to_error",
36
+ "sha2",
37
+ "signal-hook",
38
+ ]
39
+
40
+ [[package]]
41
+ name = "cfg-if"
42
+ version = "1.0.5"
43
+ source = "registry+https://github.com/rust-lang/crates.io-index"
44
+ checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
45
+
46
+ [[package]]
47
+ name = "cpufeatures"
48
+ version = "0.2.17"
49
+ source = "registry+https://github.com/rust-lang/crates.io-index"
50
+ checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
51
+ dependencies = [
52
+ "libc",
53
+ ]
54
+
55
+ [[package]]
56
+ name = "crossbeam-deque"
57
+ version = "0.8.8"
58
+ source = "registry+https://github.com/rust-lang/crates.io-index"
59
+ checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a"
60
+ dependencies = [
61
+ "crossbeam-epoch",
62
+ "crossbeam-utils",
63
+ ]
64
+
65
+ [[package]]
66
+ name = "crossbeam-epoch"
67
+ version = "0.9.21"
68
+ source = "registry+https://github.com/rust-lang/crates.io-index"
69
+ checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"
70
+ dependencies = [
71
+ "crossbeam-utils",
72
+ ]
73
+
74
+ [[package]]
75
+ name = "crossbeam-utils"
76
+ version = "0.8.23"
77
+ source = "registry+https://github.com/rust-lang/crates.io-index"
78
+ checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
79
+
80
+ [[package]]
81
+ name = "crypto-common"
82
+ version = "0.1.7"
83
+ source = "registry+https://github.com/rust-lang/crates.io-index"
84
+ checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
85
+ dependencies = [
86
+ "generic-array",
87
+ "typenum",
88
+ ]
89
+
90
+ [[package]]
91
+ name = "digest"
92
+ version = "0.10.7"
93
+ source = "registry+https://github.com/rust-lang/crates.io-index"
94
+ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
95
+ dependencies = [
96
+ "block-buffer",
97
+ "crypto-common",
98
+ ]
99
+
100
+ [[package]]
101
+ name = "dyn-clone"
102
+ version = "1.0.20"
103
+ source = "registry+https://github.com/rust-lang/crates.io-index"
104
+ checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555"
105
+
106
+ [[package]]
107
+ name = "either"
108
+ version = "1.19.0"
109
+ source = "registry+https://github.com/rust-lang/crates.io-index"
110
+ checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"
111
+
112
+ [[package]]
113
+ name = "errno"
114
+ version = "0.3.14"
115
+ source = "registry+https://github.com/rust-lang/crates.io-index"
116
+ checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
117
+ dependencies = [
118
+ "libc",
119
+ "windows-sys",
120
+ ]
121
+
122
+ [[package]]
123
+ name = "generic-array"
124
+ version = "0.14.7"
125
+ source = "registry+https://github.com/rust-lang/crates.io-index"
126
+ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
127
+ dependencies = [
128
+ "typenum",
129
+ "version_check",
130
+ ]
131
+
132
+ [[package]]
133
+ name = "itoa"
134
+ version = "1.0.18"
135
+ source = "registry+https://github.com/rust-lang/crates.io-index"
136
+ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
137
+
138
+ [[package]]
139
+ name = "libc"
140
+ version = "0.2.191"
141
+ source = "registry+https://github.com/rust-lang/crates.io-index"
142
+ checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
143
+
144
+ [[package]]
145
+ name = "memchr"
146
+ version = "2.8.3"
147
+ source = "registry+https://github.com/rust-lang/crates.io-index"
148
+ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
149
+
150
+ [[package]]
151
+ name = "proc-macro2"
152
+ version = "1.0.107"
153
+ source = "registry+https://github.com/rust-lang/crates.io-index"
154
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
155
+ dependencies = [
156
+ "unicode-ident",
157
+ ]
158
+
159
+ [[package]]
160
+ name = "quote"
161
+ version = "1.0.47"
162
+ source = "registry+https://github.com/rust-lang/crates.io-index"
163
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
164
+ dependencies = [
165
+ "proc-macro2",
166
+ ]
167
+
168
+ [[package]]
169
+ name = "rayon"
170
+ version = "1.12.0"
171
+ source = "registry+https://github.com/rust-lang/crates.io-index"
172
+ checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
173
+ dependencies = [
174
+ "either",
175
+ "rayon-core",
176
+ ]
177
+
178
+ [[package]]
179
+ name = "rayon-core"
180
+ version = "1.13.0"
181
+ source = "registry+https://github.com/rust-lang/crates.io-index"
182
+ checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
183
+ dependencies = [
184
+ "crossbeam-deque",
185
+ "crossbeam-utils",
186
+ ]
187
+
188
+ [[package]]
189
+ name = "schemars"
190
+ version = "0.8.22"
191
+ source = "registry+https://github.com/rust-lang/crates.io-index"
192
+ checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615"
193
+ dependencies = [
194
+ "dyn-clone",
195
+ "schemars_derive",
196
+ "serde",
197
+ "serde_json",
198
+ ]
199
+
200
+ [[package]]
201
+ name = "schemars_derive"
202
+ version = "0.8.22"
203
+ source = "registry+https://github.com/rust-lang/crates.io-index"
204
+ checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d"
205
+ dependencies = [
206
+ "proc-macro2",
207
+ "quote",
208
+ "serde_derive_internals",
209
+ "syn 2.0.119",
210
+ ]
211
+
212
+ [[package]]
213
+ name = "serde"
214
+ version = "1.0.229"
215
+ source = "registry+https://github.com/rust-lang/crates.io-index"
216
+ checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
217
+ dependencies = [
218
+ "serde_core",
219
+ "serde_derive",
220
+ ]
221
+
222
+ [[package]]
223
+ name = "serde_core"
224
+ version = "1.0.229"
225
+ source = "registry+https://github.com/rust-lang/crates.io-index"
226
+ checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
227
+ dependencies = [
228
+ "serde_derive",
229
+ ]
230
+
231
+ [[package]]
232
+ name = "serde_derive"
233
+ version = "1.0.229"
234
+ source = "registry+https://github.com/rust-lang/crates.io-index"
235
+ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
236
+ dependencies = [
237
+ "proc-macro2",
238
+ "quote",
239
+ "syn 3.0.9",
240
+ ]
241
+
242
+ [[package]]
243
+ name = "serde_derive_internals"
244
+ version = "0.29.1"
245
+ source = "registry+https://github.com/rust-lang/crates.io-index"
246
+ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711"
247
+ dependencies = [
248
+ "proc-macro2",
249
+ "quote",
250
+ "syn 2.0.119",
251
+ ]
252
+
253
+ [[package]]
254
+ name = "serde_json"
255
+ version = "1.0.154"
256
+ source = "registry+https://github.com/rust-lang/crates.io-index"
257
+ checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
258
+ dependencies = [
259
+ "itoa",
260
+ "memchr",
261
+ "serde",
262
+ "serde_core",
263
+ "zmij",
264
+ ]
265
+
266
+ [[package]]
267
+ name = "serde_path_to_error"
268
+ version = "0.1.20"
269
+ source = "registry+https://github.com/rust-lang/crates.io-index"
270
+ checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457"
271
+ dependencies = [
272
+ "itoa",
273
+ "serde",
274
+ "serde_core",
275
+ ]
276
+
277
+ [[package]]
278
+ name = "sha2"
279
+ version = "0.10.9"
280
+ source = "registry+https://github.com/rust-lang/crates.io-index"
281
+ checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
282
+ dependencies = [
283
+ "cfg-if",
284
+ "cpufeatures",
285
+ "digest",
286
+ ]
287
+
288
+ [[package]]
289
+ name = "signal-hook"
290
+ version = "0.3.18"
291
+ source = "registry+https://github.com/rust-lang/crates.io-index"
292
+ checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2"
293
+ dependencies = [
294
+ "libc",
295
+ "signal-hook-registry",
296
+ ]
297
+
298
+ [[package]]
299
+ name = "signal-hook-registry"
300
+ version = "1.4.8"
301
+ source = "registry+https://github.com/rust-lang/crates.io-index"
302
+ checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
303
+ dependencies = [
304
+ "errno",
305
+ "libc",
306
+ ]
307
+
308
+ [[package]]
309
+ name = "syn"
310
+ version = "2.0.119"
311
+ source = "registry+https://github.com/rust-lang/crates.io-index"
312
+ checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
313
+ dependencies = [
314
+ "proc-macro2",
315
+ "quote",
316
+ "unicode-ident",
317
+ ]
318
+
319
+ [[package]]
320
+ name = "syn"
321
+ version = "3.0.9"
322
+ source = "registry+https://github.com/rust-lang/crates.io-index"
323
+ checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
324
+ dependencies = [
325
+ "proc-macro2",
326
+ "quote",
327
+ "unicode-ident",
328
+ ]
329
+
330
+ [[package]]
331
+ name = "typenum"
332
+ version = "1.20.1"
333
+ source = "registry+https://github.com/rust-lang/crates.io-index"
334
+ checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
335
+
336
+ [[package]]
337
+ name = "unicode-ident"
338
+ version = "1.0.27"
339
+ source = "registry+https://github.com/rust-lang/crates.io-index"
340
+ checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
341
+
342
+ [[package]]
343
+ name = "version_check"
344
+ version = "0.9.5"
345
+ source = "registry+https://github.com/rust-lang/crates.io-index"
346
+ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
347
+
348
+ [[package]]
349
+ name = "windows-link"
350
+ version = "0.2.1"
351
+ source = "registry+https://github.com/rust-lang/crates.io-index"
352
+ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
353
+
354
+ [[package]]
355
+ name = "windows-sys"
356
+ version = "0.61.2"
357
+ source = "registry+https://github.com/rust-lang/crates.io-index"
358
+ checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
359
+ dependencies = [
360
+ "windows-link",
361
+ ]
362
+
363
+ [[package]]
364
+ name = "zmij"
365
+ version = "1.0.23"
366
+ source = "registry+https://github.com/rust-lang/crates.io-index"
367
+ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
@@ -0,0 +1,27 @@
1
+ [workspace]
2
+ members = ["crates/cfd-craft", "crates/cfd-craft-cli"]
3
+ exclude = ["integrations/fcmaes-cfd-worker", "bindings/python"]
4
+ resolver = "2"
5
+
6
+ [workspace.package]
7
+ version = "0.1.0"
8
+ edition = "2024"
9
+ rust-version = "1.88"
10
+ license = "MIT"
11
+ repository = "https://github.com/dietmarwo/CFD-craft"
12
+ homepage = "https://github.com/dietmarwo/CFD-craft"
13
+ keywords = ["cfd", "fluid-dynamics", "dispersion", "simulation", "air-quality"]
14
+ categories = ["science", "simulation"]
15
+
16
+ [workspace.dependencies]
17
+ serde = { version = "1", features = ["derive"] }
18
+ serde_json = { version = "1", features = ["float_roundtrip"] }
19
+ schemars = "0.8"
20
+ sha2 = "0.10"
21
+ rayon = "1"
22
+ signal-hook = "0.3"
23
+ serde_path_to_error = "0.1"
24
+
25
+ [profile.release]
26
+ debug = 1
27
+ lto = "thin"
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dietmar Wolz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,86 @@
1
+ Metadata-Version: 2.4
2
+ Name: cfd-craft
3
+ Version: 0.1.0
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Intended Audience :: Science/Research
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Rust
8
+ Classifier: Topic :: Scientific/Engineering :: Physics
9
+ Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
10
+ License-File: LICENSE
11
+ Summary: Native Cartesian flow and passive-gas dispersion research solver
12
+ Keywords: CFD,computational fluid dynamics,dispersion,air quality,simulation,Rust
13
+ License-Expression: MIT
14
+ Requires-Python: >=3.10
15
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
16
+ Project-URL: Documentation, https://github.com/dietmarwo/CFD-craft/blob/main/docs/PYTHON.md
17
+ Project-URL: Issues, https://github.com/dietmarwo/CFD-craft/issues
18
+ Project-URL: Changelog, https://github.com/dietmarwo/CFD-craft/blob/main/CHANGELOG.md
19
+ Project-URL: Optimization ecosystem, https://dietmarwo.github.io/optimization-jobs/
20
+ Project-URL: AI agent guide, https://github.com/dietmarwo/CFD-craft/blob/main/docs/ai-context.md
21
+ Project-URL: Repository, https://github.com/dietmarwo/CFD-craft
22
+
23
+ # CFD-craft for Python
24
+
25
+ A native Rust research solver for incompressible flow and passive-gas
26
+ dispersion, called in-process from Python 3.10 or newer. No NumPy, OpenFOAM or
27
+ subprocess is needed.
28
+
29
+ ```bash
30
+ pip install cfd-craft
31
+ ```
32
+
33
+ The example loads the small
34
+ [point-source case](https://github.com/dietmarwo/CFD-craft/blob/main/examples/manual/point-source.json)
35
+ of the user manual (prescribed flow, one tracer, one downstream receptor)
36
+ directly from GitHub:
37
+
38
+ ```python
39
+ import json
40
+ import urllib.request
41
+ import cfd_craft as cfd
42
+
43
+ URL = (
44
+ "https://raw.githubusercontent.com/dietmarwo/CFD-craft/main/"
45
+ "examples/manual/point-source.json"
46
+ )
47
+ with urllib.request.urlopen(URL, timeout=30) as response:
48
+ case = json.load(response)
49
+ report = cfd.check(case)
50
+ if not report["valid"]:
51
+ raise ValueError(report["diagnostics"])
52
+ result = cfd.simulate(case)
53
+ print(result["termination"], result["assessment"])
54
+ tracer = result["constituents"][0]
55
+ print(tracer["receptors_kg_m3"]["R_down"] * 1e9, "micrograms/m3")
56
+ ```
57
+
58
+ To keep a local copy, download it once (for example
59
+ `curl -O https://raw.githubusercontent.com/dietmarwo/CFD-craft/main/examples/manual/point-source.json`)
60
+ and load it with `case = json.loads(Path("point-source.json").read_text())`
61
+ after `from pathlib import Path`. `check` and `simulate` also accept a JSON
62
+ string or bytes.
63
+
64
+ `check` runs the native CLI's strict parsing and preflight and returns coded
65
+ diagnostics with JSON paths. `simulate` releases the GIL, enforces the case's
66
+ work, wall-time and thread limits and returns the same summary schema as the
67
+ Rust CLI; incomplete calculations keep their termination and assessment. Use
68
+ `cancel_file=PATH` for cooperative cancellation; Ctrl-C stops the solver and
69
+ raises `KeyboardInterrupt`. `run.memory_limit_mib` is a preflight estimate,
70
+ and the host-memory refusal applies on Linux only.
71
+
72
+ `python -m cfd_craft describe`, `check CASE.json` and `simulate CASE.json` print
73
+ JSON; the `cfd-craft-python` console script does the same. Fields,
74
+ checksummed archives, restarts and profiles belong to the Rust CLI
75
+ (`cargo install cfd-craft-cli --locked`).
76
+
77
+ Version 0.1.0 is a research prototype: experimental canyon validation and a
78
+ successful fine-grid resolution study remain open, and a numerical acceptance
79
+ is not physical validation.
80
+
81
+ - [Python API, examples and limitations](https://github.com/dietmarwo/CFD-craft/blob/main/docs/PYTHON.md)
82
+ - [Repository, user manual and evidence](https://github.com/dietmarwo/CFD-craft)
83
+ - [Changelog](https://github.com/dietmarwo/CFD-craft/blob/main/CHANGELOG.md)
84
+
85
+ MIT licensed.
86
+