pycphy 0.1.0__py3-none-any.whl → 0.2.0__py3-none-any.whl
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.
- pycphy/__init__.py +11 -0
- pycphy/cli.py +145 -0
- pycphy/config_manager.py +373 -0
- pycphy/foamCaseDeveloper/__init__.py +60 -41
- pycphy/foamCaseDeveloper/config/__init__.py +69 -26
- pycphy/foamCaseDeveloper/config/cad_mesh_config.py +62 -0
- pycphy/foamCaseDeveloper/config/config_hfdibdem.py +193 -0
- pycphy/foamCaseDeveloper/config/constant/__init__.py +23 -0
- pycphy/foamCaseDeveloper/config/constant/dynamic_mesh_config.py +208 -0
- pycphy/foamCaseDeveloper/config/constant/gravity_field_config.py +379 -0
- pycphy/foamCaseDeveloper/config/constant/transport_properties_config.py +225 -0
- pycphy/foamCaseDeveloper/config/constant/turbulence_config.py +617 -0
- pycphy/foamCaseDeveloper/config/csv_boundary_reader.py +219 -0
- pycphy/foamCaseDeveloper/config/system/__init__.py +31 -0
- pycphy/foamCaseDeveloper/config/system/block_mesh_config.py +184 -0
- pycphy/foamCaseDeveloper/config/{control_config.py → system/control_config.py} +113 -1
- pycphy/foamCaseDeveloper/config/system/decompose_par_config.py +525 -0
- pycphy/foamCaseDeveloper/config/system/fv_options_config.py +575 -0
- pycphy/foamCaseDeveloper/config/system/fv_schemes_config.py +363 -0
- pycphy/foamCaseDeveloper/config/system/set_fields_config.py +640 -0
- pycphy/foamCaseDeveloper/config/system/snappy_hex_mesh_config.py +241 -0
- pycphy/foamCaseDeveloper/config/zero/U_config.py +135 -0
- pycphy/foamCaseDeveloper/config/zero/__init__.py +22 -0
- pycphy/foamCaseDeveloper/config/zero/f_config.py +140 -0
- pycphy/foamCaseDeveloper/config/zero/lambda_config.py +157 -0
- pycphy/foamCaseDeveloper/config/zero/p_config.py +97 -0
- pycphy/foamCaseDeveloper/core/__init__.py +30 -18
- pycphy/foamCaseDeveloper/core/block_mesh_developer.py +1 -1
- pycphy/foamCaseDeveloper/core/cad_block_mesh_developer.py +463 -0
- pycphy/foamCaseDeveloper/core/case_builder.py +1217 -0
- pycphy/foamCaseDeveloper/core/foam_case_manager.py +370 -111
- pycphy/foamCaseDeveloper/develop_case.py +640 -0
- pycphy/foamCaseDeveloper/main.py +260 -260
- pycphy/foamCaseDeveloper/utils/myAutoCAD.py +418 -0
- pycphy/foamCaseDeveloper/writers/__init__.py +37 -4
- pycphy/foamCaseDeveloper/writers/constant/__init__.py +25 -0
- pycphy/foamCaseDeveloper/writers/constant/dynamic_mesh_dict_writer.py +75 -0
- pycphy/foamCaseDeveloper/writers/constant/gravity_field_writer.py +88 -0
- pycphy/foamCaseDeveloper/writers/constant/hfdibdem_dict_writer.py +81 -0
- pycphy/foamCaseDeveloper/writers/constant/transport_properties_writer.py +202 -0
- pycphy/foamCaseDeveloper/writers/{turbulence_properties_writer.py → constant/turbulence_properties_writer.py} +49 -1
- pycphy/foamCaseDeveloper/writers/system/__init__.py +31 -0
- pycphy/foamCaseDeveloper/writers/{block_mesh_writer.py → system/block_mesh_writer.py} +1 -1
- pycphy/foamCaseDeveloper/writers/{control_dict_writer.py → system/control_dict_writer.py} +37 -1
- pycphy/foamCaseDeveloper/writers/system/decompose_par_writer.py +228 -0
- pycphy/foamCaseDeveloper/writers/system/fv_options_writer.py +188 -0
- pycphy/foamCaseDeveloper/writers/system/fv_schemes_writer.py +155 -0
- pycphy/foamCaseDeveloper/writers/system/set_fields_writer.py +191 -0
- pycphy/foamCaseDeveloper/writers/system/snappy_hex_mesh_writer.py +123 -0
- pycphy/foamCaseDeveloper/writers/zero/__init__.py +24 -0
- pycphy/foamCaseDeveloper/writers/zero/f_field_writer.py +89 -0
- pycphy/foamCaseDeveloper/writers/zero/lambda_field_writer.py +84 -0
- pycphy/foamCaseDeveloper/writers/zero/p_field_writer.py +89 -0
- pycphy/foamCaseDeveloper/writers/zero/u_field_writer.py +96 -0
- pycphy/foamCaseDeveloper/writers/zero/zero_field_factory.py +388 -0
- {pycphy-0.1.0.dist-info → pycphy-0.2.0.dist-info}/METADATA +154 -6
- pycphy-0.2.0.dist-info/RECORD +63 -0
- pycphy-0.2.0.dist-info/entry_points.txt +3 -0
- pycphy/foamCaseDeveloper/config/block_mesh_config.py +0 -90
- pycphy/foamCaseDeveloper/config/turbulence_config.py +0 -187
- pycphy/foamCaseDeveloper/core/control_dict_writer.py +0 -55
- pycphy/foamCaseDeveloper/core/turbulence_properties_writer.py +0 -68
- pycphy-0.1.0.dist-info/RECORD +0 -24
- pycphy-0.1.0.dist-info/entry_points.txt +0 -2
- {pycphy-0.1.0.dist-info → pycphy-0.2.0.dist-info}/WHEEL +0 -0
- {pycphy-0.1.0.dist-info → pycphy-0.2.0.dist-info}/licenses/LICENSE +0 -0
- {pycphy-0.1.0.dist-info → pycphy-0.2.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,63 @@
|
|
1
|
+
pycphy/__init__.py,sha256=ELtkPpa66dsbbLl0XXwx2L5_qfkOFxS9MIEU9Bc4vb0,765
|
2
|
+
pycphy/cli.py,sha256=qgYhwBOGm5egy6hafdt9S4sNwowFWD_EN4_xQAaxaXU,5055
|
3
|
+
pycphy/config_manager.py,sha256=zGVqXFqGdvmLQGZy8V3fUZLe3JwgVG1MSaOIB8JqIbc,12753
|
4
|
+
pycphy/foamCaseDeveloper/__init__.py,sha256=RQvv9G5bc-_Dz-EO88kTb-bVRy7Iq-Brq-RAWjHudXY,1352
|
5
|
+
pycphy/foamCaseDeveloper/develop_case.py,sha256=frRkfYcRR0N6E7VRwGY7Ko_6kwSrnY1VDny1OdgQcrA,29843
|
6
|
+
pycphy/foamCaseDeveloper/main.py,sha256=4Nh52FIuFCVf3hkGRknGq1-UitXXP87Cfa7MADxuYCk,8672
|
7
|
+
pycphy/foamCaseDeveloper/config/__init__.py,sha256=OnyXB8YfB0F17a3ihqBQAFmlLupRj1TkEddr2B64g8M,1699
|
8
|
+
pycphy/foamCaseDeveloper/config/cad_mesh_config.py,sha256=W0dqGAU-irtDpvRLWJ0nMGHlGhTcwmcnbCVqxj9lPBw,1657
|
9
|
+
pycphy/foamCaseDeveloper/config/config_hfdibdem.py,sha256=EFaw2lFN-eBEHt4Zjmxb3y-q4f6Xl_CO58KMTSDjOpY,7443
|
10
|
+
pycphy/foamCaseDeveloper/config/csv_boundary_reader.py,sha256=VEp6iLzTEzcHTyl_ahAOgQ7c4blTt8GWllDEkQ7ofd0,8085
|
11
|
+
pycphy/foamCaseDeveloper/config/global_config.py,sha256=RgUUYCidlzuTRMgiswDQ69OSQgler9Rz3QZzSP1vw2g,2988
|
12
|
+
pycphy/foamCaseDeveloper/config/constant/__init__.py,sha256=AdHpNUtKjplI9pyHxrxEcdtrqRNA8rHf5EcdR0kPhuY,554
|
13
|
+
pycphy/foamCaseDeveloper/config/constant/dynamic_mesh_config.py,sha256=4eRzxQLHdqKRwKOQzYSFjlC7Iz3NIZVkoxvLr5_MFCo,10471
|
14
|
+
pycphy/foamCaseDeveloper/config/constant/gravity_field_config.py,sha256=4kirnuCyaFkw12suMZci56fz_reWV1SMbMMOyayNnoc,12361
|
15
|
+
pycphy/foamCaseDeveloper/config/constant/transport_properties_config.py,sha256=VxL6BNvtRR6YHOMwMlI8RtXC7ho4dNbKZEuLEiPvGvM,8999
|
16
|
+
pycphy/foamCaseDeveloper/config/constant/turbulence_config.py,sha256=sJyNVycTft0oU2zaO2pdPSjPHNKwssXAzKEWY0Q_yhA,24797
|
17
|
+
pycphy/foamCaseDeveloper/config/system/__init__.py,sha256=5uF-EMqep2dFRxziziZLDsVErasHz3_piE4V0u3jKQE,715
|
18
|
+
pycphy/foamCaseDeveloper/config/system/block_mesh_config.py,sha256=22WYdR9QxqQSJdS8-Nf_Tx7YQrpLRw3-JwQKZKRSqek,7366
|
19
|
+
pycphy/foamCaseDeveloper/config/system/control_config.py,sha256=IXCbjhlV3__qg9TbMwkSObZLmn9Xl3N6WByaA4Src6A,11310
|
20
|
+
pycphy/foamCaseDeveloper/config/system/decompose_par_config.py,sha256=0umgkGXtbBaD3rYZHX4sMYFm6ff2XL8RDT-ucD5RU7I,16287
|
21
|
+
pycphy/foamCaseDeveloper/config/system/fv_options_config.py,sha256=asauP7tMnEfX4MBvoaGFHXdxK6E0LaegIHtZwBvDD5E,19456
|
22
|
+
pycphy/foamCaseDeveloper/config/system/fv_schemes_config.py,sha256=_QraILhq32x-KkmEmfpEtwG6Il6E-XG9V88Wo9Sp5mg,16331
|
23
|
+
pycphy/foamCaseDeveloper/config/system/set_fields_config.py,sha256=B1KDD5zL_9D47SizJztAjFVozWLN8HLMF3FDb1YxdBY,21070
|
24
|
+
pycphy/foamCaseDeveloper/config/system/snappy_hex_mesh_config.py,sha256=WfIJPtIl-6KrOnb7h7sRwLmXaJ62Abf4Azhb07DShQA,8547
|
25
|
+
pycphy/foamCaseDeveloper/config/zero/U_config.py,sha256=0wfXtOlcALO2WMW1ye3FqsEQPz7SqdngqIRtd6WcltM,5056
|
26
|
+
pycphy/foamCaseDeveloper/config/zero/__init__.py,sha256=Dm21LOv3CFq8THXEd9nldh2FhdHA4_cYcvntj7rpTlg,432
|
27
|
+
pycphy/foamCaseDeveloper/config/zero/f_config.py,sha256=1sZ4dxH__DXaLO6zFKCIjx9EYgsHWuClmts5k-58hTQ,5116
|
28
|
+
pycphy/foamCaseDeveloper/config/zero/lambda_config.py,sha256=k9TwYBqCEGOgZuLdS2N8bv040SDcDFdOdMnyqeDP_eg,5862
|
29
|
+
pycphy/foamCaseDeveloper/config/zero/p_config.py,sha256=0DDZn_M650HhhGuIEz9XLwZKl7Qm1hLXd9M-K2PlAj8,3608
|
30
|
+
pycphy/foamCaseDeveloper/core/__init__.py,sha256=zUpx-G3-zvNZk-Ch-PPcgHQw5B1lnRc8EuAAr2nV5cI,760
|
31
|
+
pycphy/foamCaseDeveloper/core/block_mesh_developer.py,sha256=vK5LAhhLhwWFgHO7902D2CVGIaZdwZjdto1rKhHxfXs,3609
|
32
|
+
pycphy/foamCaseDeveloper/core/cad_block_mesh_developer.py,sha256=rMnXRCDX2zQtYqeUMWPhGE-cnF91A82RBRCUCbk6DVw,19245
|
33
|
+
pycphy/foamCaseDeveloper/core/case_builder.py,sha256=8dqy-igaWmqIiwmRIZICvI2qmG60ERc98F1sxvC7d1U,48088
|
34
|
+
pycphy/foamCaseDeveloper/core/foam_case_manager.py,sha256=j0X6e0j2bkRo1Kf_hoTnw0TJvfNDt89brEJceMXXEkc,20988
|
35
|
+
pycphy/foamCaseDeveloper/utils/myAutoCAD.py,sha256=2Ri9oderhO9dp3k6NRc9SGKsXNVEuzj3a-WLcMv7BOo,16266
|
36
|
+
pycphy/foamCaseDeveloper/writers/__init__.py,sha256=3L1Du1bciQrHQWCM2mzsf-OCPq_GUgj5MxamCWEyJgw,1766
|
37
|
+
pycphy/foamCaseDeveloper/writers/foam_writer.py,sha256=KMfQ-338UUg6mEIyW_-55DbcK5UHVihqOXYT0BSsA1M,2854
|
38
|
+
pycphy/foamCaseDeveloper/writers/constant/__init__.py,sha256=wN-EUtBUCzWkkWWSIPlxvbOs-h0Hl35hb51NLDAqi7E,637
|
39
|
+
pycphy/foamCaseDeveloper/writers/constant/dynamic_mesh_dict_writer.py,sha256=dl7uL5Do1IKevZ4llobMRItYQwPld73k67g8nJw-hHI,3041
|
40
|
+
pycphy/foamCaseDeveloper/writers/constant/gravity_field_writer.py,sha256=bkgqOa1fC8mJR_BKhANCaVpraTbcOPoP7tcgA9tqpRU,3323
|
41
|
+
pycphy/foamCaseDeveloper/writers/constant/hfdibdem_dict_writer.py,sha256=-MT-AuA3WWH4a2EjyC51Gm3GUj-WCvdv7I31mAGipa4,3487
|
42
|
+
pycphy/foamCaseDeveloper/writers/constant/transport_properties_writer.py,sha256=G4W8grlNsAovC5sQohPj6aRIT4iO00P5gZPuu6g7o6w,8687
|
43
|
+
pycphy/foamCaseDeveloper/writers/constant/turbulence_properties_writer.py,sha256=tPMcU2iHnIHdGImupWeEVbOKCjrYhJXKjq8ySRdWRvM,5342
|
44
|
+
pycphy/foamCaseDeveloper/writers/system/__init__.py,sha256=X_H41LaLZNpAMP3kd_EJ0dF5n_dMLzzPkJvGrGFSqIM,711
|
45
|
+
pycphy/foamCaseDeveloper/writers/system/block_mesh_writer.py,sha256=tRCe7ir_uVHs0WHdDkqMPQuc_vv5nVqOYXQP1vXtaR0,4878
|
46
|
+
pycphy/foamCaseDeveloper/writers/system/control_dict_writer.py,sha256=TtwaV9Npq0inXNob2eo8c3eGuTWFmlkzJCAz90t3AnU,3279
|
47
|
+
pycphy/foamCaseDeveloper/writers/system/decompose_par_writer.py,sha256=h54b2KF48sxVbZ27J1iMfRGnMBAlAQBceMXQvXZ8ulc,9137
|
48
|
+
pycphy/foamCaseDeveloper/writers/system/fv_options_writer.py,sha256=C42lHaRLVJSVcfJjvcoRddR_TS4IuJGhJEuaZlf1kvk,8568
|
49
|
+
pycphy/foamCaseDeveloper/writers/system/fv_schemes_writer.py,sha256=yvagLK77Wpv2OqNL0MZISIlbdlccCxQYEvCuINOco_U,6660
|
50
|
+
pycphy/foamCaseDeveloper/writers/system/set_fields_writer.py,sha256=VSEdXv9nEp7g6V2YXj6OVGTwSqJDaVvAvZ_Slh0cMkM,7516
|
51
|
+
pycphy/foamCaseDeveloper/writers/system/snappy_hex_mesh_writer.py,sha256=D-K-6U6OCpiaXi6cZu0wEb-3JVb-6xQEurLrwllP32o,5391
|
52
|
+
pycphy/foamCaseDeveloper/writers/zero/__init__.py,sha256=9naTIdhKLbia6pq9Y5b8fJWApvtgl4NpTaxSFk8iojs,530
|
53
|
+
pycphy/foamCaseDeveloper/writers/zero/f_field_writer.py,sha256=MrLAsbpH2Y_QXY6-gBXAMMChMxjVYPPJnF6gd2C4JHU,3240
|
54
|
+
pycphy/foamCaseDeveloper/writers/zero/lambda_field_writer.py,sha256=xZPiCjjYD_aagn3gNkn56uHnErzgO5kG7J8iVI7jLNk,3000
|
55
|
+
pycphy/foamCaseDeveloper/writers/zero/p_field_writer.py,sha256=Gedq9ub1xDzeHOT8xtjnKwC_7OWx8KZQSkPl28b60Ok,3319
|
56
|
+
pycphy/foamCaseDeveloper/writers/zero/u_field_writer.py,sha256=uHg3Hsg3SVxm8TGuoUug5ovlULxAIlpmuRcfIoDP7s4,3710
|
57
|
+
pycphy/foamCaseDeveloper/writers/zero/zero_field_factory.py,sha256=fcGH_wGnjV15oVcHRY2NmvIOczRnzUeI2a-8Pz3OyO0,15838
|
58
|
+
pycphy-0.2.0.dist-info/licenses/LICENSE,sha256=SO-nbkWPNmUErH6Zw-SxD-3bGgO9j9euAnYU8K6Gjeo,1093
|
59
|
+
pycphy-0.2.0.dist-info/METADATA,sha256=2wNanErlq5AmNHxezzrM2tfZv4f1spef_J3rP05kM70,14962
|
60
|
+
pycphy-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
61
|
+
pycphy-0.2.0.dist-info/entry_points.txt,sha256=KX-nFo5X4WGNIegcDyxUnT4Xmo5rwGnBT-fq8PLOPGE,108
|
62
|
+
pycphy-0.2.0.dist-info/top_level.txt,sha256=w2z-jwGibnt6eh8y4z7LvsPL6I2196b8m_Jxl0XB3PM,7
|
63
|
+
pycphy-0.2.0.dist-info/RECORD,,
|
@@ -1,90 +0,0 @@
|
|
1
|
-
# block_mesh_config.py
|
2
|
-
|
3
|
-
# =============================================================================
|
4
|
-
# *** User Input Configuration for blockMeshDict Generation ***
|
5
|
-
# =============================================================================
|
6
|
-
#
|
7
|
-
# Modify the values in this file to define the desired geometry,
|
8
|
-
# mesh resolution, and boundary patch names.
|
9
|
-
#
|
10
|
-
|
11
|
-
# --- 1. Geometry Definition ---
|
12
|
-
|
13
|
-
# `p0`: The minimum corner of the computational domain (x_min, y_min, z_min).
|
14
|
-
# This defines the bottom-left-front corner of the geometry.
|
15
|
-
# Example: (0.0, 0.0, 0.0) for a domain starting at the origin
|
16
|
-
p0 = (0.0, 0.0, 0.0)
|
17
|
-
|
18
|
-
# `p1`: The maximum corner of the computational domain (x_max, y_max, z_max).
|
19
|
-
# This defines the top-right-back corner of the geometry.
|
20
|
-
# Example: (0.5, 0.2, 0.1) for a channel 0.5m long, 0.2m wide, 0.1m high
|
21
|
-
p1 = (0.5, 0.2, 0.1)
|
22
|
-
|
23
|
-
# --- 2. Meshing Parameters ---
|
24
|
-
|
25
|
-
# `cells`: Number of cells in each direction (nx, ny, nz).
|
26
|
-
# This determines the mesh resolution. Higher numbers = finer mesh = longer computation time.
|
27
|
-
# Example: (50, 20, 50) means 50 cells in x-direction, 20 in y-direction, 50 in z-direction
|
28
|
-
# Total cells = nx * ny * nz = 50 * 20 * 50 = 50,000 cells
|
29
|
-
cells = (50, 20, 50)
|
30
|
-
|
31
|
-
# `scale`: Scaling factor for the mesh coordinates.
|
32
|
-
# Usually set to 1.0 for actual dimensions. Use other values to scale the entire geometry.
|
33
|
-
# Example: 1.0 for meters, 0.001 for millimeters, 1000 for kilometers
|
34
|
-
scale = 1.0
|
35
|
-
|
36
|
-
# --- 3. Boundary Patch Names ---
|
37
|
-
|
38
|
-
# `patch_names`: Dictionary mapping geometric faces to boundary patch names.
|
39
|
-
# These names will be used in boundary condition files and OpenFOAM dictionaries.
|
40
|
-
#
|
41
|
-
# Face identifiers:
|
42
|
-
# 'minX': Face at minimum X (x = p0[0])
|
43
|
-
# 'maxX': Face at maximum X (x = p1[0])
|
44
|
-
# 'minY': Face at minimum Y (y = p0[1])
|
45
|
-
# 'maxY': Face at maximum Y (y = p1[1])
|
46
|
-
# 'minZ': Face at minimum Z (z = p0[2])
|
47
|
-
# 'maxZ': Face at maximum Z (z = p1[2])
|
48
|
-
#
|
49
|
-
# Common patch types in OpenFOAM:
|
50
|
-
# - 'patch': General boundary patch
|
51
|
-
# - 'wall': Solid wall boundary
|
52
|
-
# - 'symmetryPlane': Symmetry boundary
|
53
|
-
# - 'empty': 2D simulation (front/back faces)
|
54
|
-
#
|
55
|
-
# Example for channel flow:
|
56
|
-
patch_names = {
|
57
|
-
'minX': 'inlet', # Inlet face (flow enters here)
|
58
|
-
'maxX': 'outlet', # Outlet face (flow exits here)
|
59
|
-
'minY': 'frontWall', # Front wall (solid boundary)
|
60
|
-
'maxY': 'backWall', # Back wall (solid boundary)
|
61
|
-
'minZ': 'floor', # Floor (solid boundary)
|
62
|
-
'maxZ': 'ceiling' # Ceiling (solid boundary)
|
63
|
-
}
|
64
|
-
|
65
|
-
# --- 4. Advanced Meshing Options ---
|
66
|
-
|
67
|
-
# `grading`: Cell size grading for each direction.
|
68
|
-
# Controls how cell sizes change across the domain.
|
69
|
-
# Example: (1, 1, 1) for uniform cells, (2, 1, 0.5) for graded cells
|
70
|
-
# Note: These are used in the blockMeshDict but not currently exposed in the simple interface
|
71
|
-
grading = (1, 1, 1)
|
72
|
-
|
73
|
-
# `merge_patch_pairs`: List of patch pairs to merge (for periodic boundaries).
|
74
|
-
# Example: [('leftWall', 'rightWall')] to create a periodic boundary
|
75
|
-
# Currently not implemented in the simple interface
|
76
|
-
merge_patch_pairs = []
|
77
|
-
|
78
|
-
# --- 5. Validation Settings ---
|
79
|
-
|
80
|
-
# `min_cell_size`: Minimum allowed cell size (for validation).
|
81
|
-
# Used to prevent extremely small cells that could cause numerical issues.
|
82
|
-
min_cell_size = 1e-6
|
83
|
-
|
84
|
-
# `max_cell_size`: Maximum allowed cell size (for validation).
|
85
|
-
# Used to prevent extremely large cells that could cause accuracy issues.
|
86
|
-
max_cell_size = 1.0
|
87
|
-
|
88
|
-
# `max_total_cells`: Maximum allowed total number of cells (for validation).
|
89
|
-
# Used to prevent creating meshes that are too large for available computational resources.
|
90
|
-
max_total_cells = 1000000
|
@@ -1,187 +0,0 @@
|
|
1
|
-
# turbulence_config.py
|
2
|
-
|
3
|
-
# =============================================================================
|
4
|
-
# *** User Input for turbulenceProperties ***
|
5
|
-
# =============================================================================
|
6
|
-
#
|
7
|
-
# This file defines the turbulence model settings.
|
8
|
-
# 1. Set the SIMULATION_TYPE variable to 'RAS', 'LES', or 'laminar'.
|
9
|
-
# 2. Edit the corresponding properties dictionary below if needed.
|
10
|
-
#
|
11
|
-
|
12
|
-
# `SIMULATION_TYPE`: The type of turbulence simulation to perform.
|
13
|
-
# This determines which turbulence model will be used.
|
14
|
-
# Options:
|
15
|
-
# 'RAS': Reynolds-Averaged Simulation (steady or unsteady, computationally efficient)
|
16
|
-
# 'LES': Large Eddy Simulation (unsteady, more detailed but computationally expensive)
|
17
|
-
# 'laminar': Laminar flow (no turbulence model, for low Reynolds number flows)
|
18
|
-
SIMULATION_TYPE = "RAS"
|
19
|
-
|
20
|
-
# --- Reynolds-Averaged Simulation (RAS) Properties ---
|
21
|
-
# RAS models solve the Reynolds-averaged Navier-Stokes equations and model
|
22
|
-
# the effects of turbulence using statistical models. They are computationally
|
23
|
-
# less expensive and are suitable for many steady-state industrial flows.
|
24
|
-
|
25
|
-
RAS_PROPERTIES = {
|
26
|
-
# `RASModel`: Specifies the turbulence model to use.
|
27
|
-
# This determines how the Reynolds stresses are modeled.
|
28
|
-
# Common Options:
|
29
|
-
# 'kEpsilon': Standard k-epsilon model. Robust but less accurate for separated flows.
|
30
|
-
# Good for free shear flows, mixing layers, and jets.
|
31
|
-
# 'realizableKE': A variation of k-epsilon with better performance for rotating flows.
|
32
|
-
# Improved handling of adverse pressure gradients.
|
33
|
-
# 'kOmegaSST': Menter's Shear Stress Transport model. Very popular, blends k-w
|
34
|
-
# near walls and k-e in the far-field. Excellent for aerodynamics
|
35
|
-
# and complex flows with separation.
|
36
|
-
# 'SpalartAllmaras': One-equation model. Good for aerospace applications.
|
37
|
-
# Particularly effective for attached flows.
|
38
|
-
"RASModel": "kOmegaSST",
|
39
|
-
|
40
|
-
# `turbulence`: A switch to turn the turbulence calculations on or off.
|
41
|
-
# This allows you to run laminar simulations with RAS setup.
|
42
|
-
# Options: 'on' (turbulence active), 'off' (laminar simulation)
|
43
|
-
"turbulence": "on",
|
44
|
-
|
45
|
-
# `printCoeffs`: Prints the model coefficients to the log file at the start.
|
46
|
-
# This is useful for debugging and verifying model settings.
|
47
|
-
# Options: 'on' (print coefficients), 'off' (don't print)
|
48
|
-
"printCoeffs": "on",
|
49
|
-
|
50
|
-
# Additional RAS model coefficients (advanced users only)
|
51
|
-
# These can be used to modify the default model coefficients if needed.
|
52
|
-
# Most users should not modify these unless they understand the model physics.
|
53
|
-
|
54
|
-
# `kEpsilonCoeffs`: Coefficients for k-epsilon models (if using kEpsilon or realizableKE)
|
55
|
-
# "kEpsilonCoeffs": {
|
56
|
-
# "Cmu": 0.09, # Turbulent viscosity coefficient
|
57
|
-
# "C1": 1.44, # Production coefficient
|
58
|
-
# "C2": 1.92, # Destruction coefficient
|
59
|
-
# "C3": -0.33, # Buoyancy coefficient
|
60
|
-
# "sigmap": 1.0, # Prandtl number for pressure
|
61
|
-
# "sigmak": 1.0, # Prandtl number for k
|
62
|
-
# "sigmaEps": 1.3 # Prandtl number for epsilon
|
63
|
-
# },
|
64
|
-
|
65
|
-
# `kOmegaSSTCoeffs`: Coefficients for k-omega SST model (if using kOmegaSST)
|
66
|
-
# "kOmegaSSTCoeffs": {
|
67
|
-
# "beta1": 0.075, # Beta coefficient for k equation
|
68
|
-
# "beta2": 0.0828, # Beta coefficient for omega equation
|
69
|
-
# "betaStar": 0.09, # Beta star coefficient
|
70
|
-
# "gamma1": 0.5532, # Gamma coefficient for k equation
|
71
|
-
# "gamma2": 0.4403, # Gamma coefficient for omega equation
|
72
|
-
# "alphaK1": 0.85, # Alpha coefficient for k equation
|
73
|
-
# "alphaK2": 1.0, # Alpha coefficient for k equation
|
74
|
-
# "alphaOmega1": 0.5, # Alpha coefficient for omega equation
|
75
|
-
# "alphaOmega2": 0.856, # Alpha coefficient for omega equation
|
76
|
-
# "Prt": 0.9 # Turbulent Prandtl number
|
77
|
-
# }
|
78
|
-
}
|
79
|
-
|
80
|
-
# --- Large Eddy Simulation (LES) Properties ---
|
81
|
-
# LES resolves the large, energy-containing eddies directly and models the
|
82
|
-
# smaller ones using sub-grid scale (SGS) models. It is more computationally
|
83
|
-
# expensive than RAS but provides more detail on transient turbulent structures.
|
84
|
-
|
85
|
-
LES_PROPERTIES = {
|
86
|
-
# `LESModel`: Specifies the sub-grid scale (SGS) model for LES.
|
87
|
-
# This determines how the unresolved small-scale turbulence is modeled.
|
88
|
-
# Common Options:
|
89
|
-
# 'Smagorinsky': The classic SGS model. Simple and robust but can be
|
90
|
-
# overly dissipative near walls.
|
91
|
-
# 'kEqn': One-equation eddy-viscosity model. Solves an equation for
|
92
|
-
# sub-grid scale kinetic energy. More accurate than Smagorinsky.
|
93
|
-
# 'WALE': Wall-Adapting Local Eddy-viscosity model. Better near-wall
|
94
|
-
# behavior than Smagorinsky.
|
95
|
-
# 'dynamicKEqn': Dynamic version of kEqn model. Coefficients are
|
96
|
-
# computed dynamically, more accurate but computationally expensive.
|
97
|
-
"LESModel": "kEqn",
|
98
|
-
|
99
|
-
# `turbulence`: A switch to turn the turbulence calculations on or off.
|
100
|
-
# Options: 'on' (LES active), 'off' (laminar simulation)
|
101
|
-
"turbulence": "on",
|
102
|
-
|
103
|
-
# `printCoeffs`: Prints the model coefficients to the log file at the start.
|
104
|
-
# Options: 'on' (print coefficients), 'off' (don't print)
|
105
|
-
"printCoeffs": "on",
|
106
|
-
|
107
|
-
# `delta`: The model for the LES filter width.
|
108
|
-
# This determines how the characteristic length scale is calculated.
|
109
|
-
# Common Options:
|
110
|
-
# 'cubeRootVol': Based on the cell volume. (Most common and recommended)
|
111
|
-
# 'vanDriest': Wall-damping model. Reduces filter width near walls.
|
112
|
-
# 'smooth': Smoothing for the delta field. Helps with mesh sensitivity.
|
113
|
-
"delta": "smooth",
|
114
|
-
|
115
|
-
# Each delta model and some LES models have their own coefficient sub-dictionaries.
|
116
|
-
# The structure below is an example for the kEqn model with smooth delta.
|
117
|
-
|
118
|
-
# `cubeRootVolCoeffs`: Coefficients for cubeRootVol delta model
|
119
|
-
"cubeRootVolCoeffs": {
|
120
|
-
# `deltaCoeff`: Coefficient for the filter width calculation.
|
121
|
-
# Typical range: 0.5 to 2.0. Higher values = larger filter width.
|
122
|
-
"deltaCoeff": 1
|
123
|
-
},
|
124
|
-
|
125
|
-
# `smoothCoeffs`: Coefficients for smooth delta model
|
126
|
-
"smoothCoeffs": {
|
127
|
-
# `delta`: The base delta model to use for smoothing.
|
128
|
-
"delta": "cubeRootVol",
|
129
|
-
|
130
|
-
# `cubeRootVolCoeffs`: Coefficients for the base delta model
|
131
|
-
"cubeRootVolCoeffs": {
|
132
|
-
"deltaCoeff": 1
|
133
|
-
},
|
134
|
-
|
135
|
-
# `maxDeltaRatio`: Maximum ratio between adjacent delta values.
|
136
|
-
# This prevents large jumps in filter width between cells.
|
137
|
-
# Typical range: 1.1 to 1.5
|
138
|
-
"maxDeltaRatio": 1.1
|
139
|
-
},
|
140
|
-
|
141
|
-
# Additional LES model coefficients (advanced users only)
|
142
|
-
# `kEqnCoeffs`: Coefficients for kEqn LES model (if using kEqn)
|
143
|
-
# "kEqnCoeffs": {
|
144
|
-
# "Ck": 0.094, # Model coefficient
|
145
|
-
# "Ce": 1.048 # Dissipation coefficient
|
146
|
-
# },
|
147
|
-
|
148
|
-
# `SmagorinskyCoeffs`: Coefficients for Smagorinsky model (if using Smagorinsky)
|
149
|
-
# "SmagorinskyCoeffs": {
|
150
|
-
# "Ck": 0.094 # Smagorinsky constant
|
151
|
-
# },
|
152
|
-
|
153
|
-
# `WALECoeffs`: Coefficients for WALE model (if using WALE)
|
154
|
-
# "WALECoeffs": {
|
155
|
-
# "Cw": 0.325 # WALE constant
|
156
|
-
# }
|
157
|
-
|
158
|
-
# Add other coefficient dictionaries like 'vanDriestCoeffs' if your model needs them.
|
159
|
-
}
|
160
|
-
|
161
|
-
# --- Laminar Simulation Properties ---
|
162
|
-
# For flows at low Reynolds numbers where turbulence is not present.
|
163
|
-
# The dictionary is typically empty as no turbulence modeling is required.
|
164
|
-
|
165
|
-
LAMINAR_PROPERTIES = {
|
166
|
-
# For laminar flows, no turbulence model coefficients are needed.
|
167
|
-
# This dictionary is kept for consistency but should remain empty.
|
168
|
-
# If you need to add any laminar-specific parameters in the future,
|
169
|
-
# they would go here.
|
170
|
-
}
|
171
|
-
|
172
|
-
# --- Additional Turbulence Settings ---
|
173
|
-
|
174
|
-
# `turbulenceOn`: Global switch for turbulence calculations.
|
175
|
-
# This can be used to quickly disable turbulence for testing.
|
176
|
-
# Options: True (turbulence active), False (laminar simulation)
|
177
|
-
turbulenceOn = True
|
178
|
-
|
179
|
-
# `turbulenceCorrected`: Enable turbulence corrections for better accuracy.
|
180
|
-
# This is useful for complex geometries and flow conditions.
|
181
|
-
# Options: True (enable corrections), False (disable corrections)
|
182
|
-
turbulenceCorrected = True
|
183
|
-
|
184
|
-
# `turbulenceDebug`: Enable debug output for turbulence calculations.
|
185
|
-
# This provides detailed information about turbulence model behavior.
|
186
|
-
# Options: True (debug on), False (debug off)
|
187
|
-
turbulenceDebug = False
|
@@ -1,55 +0,0 @@
|
|
1
|
-
# control_dict_writer.py
|
2
|
-
|
3
|
-
from ..writers.control_dict_writer import ControlDictWriter as BaseControlDictWriter
|
4
|
-
|
5
|
-
class ControlDictWriter(BaseControlDictWriter):
|
6
|
-
"""
|
7
|
-
Extended ControlDictWriter with additional functionality for case management.
|
8
|
-
"""
|
9
|
-
|
10
|
-
def __init__(self, file_path, params):
|
11
|
-
"""
|
12
|
-
Initializes the ControlDictWriter.
|
13
|
-
|
14
|
-
Args:
|
15
|
-
file_path (str): The full path to the output file 'controlDict'.
|
16
|
-
params (dict): A dictionary containing the key-value pairs for the controlDict.
|
17
|
-
e.g., {'application': 'icoFoam', 'deltaT': 0.001}
|
18
|
-
"""
|
19
|
-
super().__init__(file_path, params)
|
20
|
-
|
21
|
-
def validate_params(self):
|
22
|
-
"""
|
23
|
-
Validates the control parameters for common issues.
|
24
|
-
|
25
|
-
Returns:
|
26
|
-
bool: True if validation passes, False otherwise.
|
27
|
-
"""
|
28
|
-
required_params = ['application', 'startFrom', 'stopAt']
|
29
|
-
|
30
|
-
for param in required_params:
|
31
|
-
if param not in self.params:
|
32
|
-
print(f"Warning: Required parameter '{param}' is missing from control parameters.")
|
33
|
-
return False
|
34
|
-
|
35
|
-
# Validate application
|
36
|
-
valid_applications = [
|
37
|
-
'icoFoam', 'simpleFoam', 'pimpleFoam', 'interFoam',
|
38
|
-
'rhoSimpleFoam', 'rhoPimpleFoam', 'buoyantFoam'
|
39
|
-
]
|
40
|
-
|
41
|
-
if self.params.get('application') not in valid_applications:
|
42
|
-
print(f"Warning: Application '{self.params.get('application')}' may not be a valid OpenFOAM solver.")
|
43
|
-
|
44
|
-
# Validate time step
|
45
|
-
if 'deltaT' in self.params:
|
46
|
-
try:
|
47
|
-
delta_t = float(self.params['deltaT'])
|
48
|
-
if delta_t <= 0:
|
49
|
-
print("Warning: deltaT should be positive.")
|
50
|
-
return False
|
51
|
-
except (ValueError, TypeError):
|
52
|
-
print("Warning: deltaT should be a valid number.")
|
53
|
-
return False
|
54
|
-
|
55
|
-
return True
|
@@ -1,68 +0,0 @@
|
|
1
|
-
# turbulence_properties_writer.py
|
2
|
-
|
3
|
-
from ..writers.turbulence_properties_writer import TurbulencePropertiesWriter as BaseTurbulencePropertiesWriter
|
4
|
-
|
5
|
-
class TurbulencePropertiesWriter(BaseTurbulencePropertiesWriter):
|
6
|
-
"""
|
7
|
-
Extended TurbulencePropertiesWriter with additional functionality for case management.
|
8
|
-
"""
|
9
|
-
|
10
|
-
def __init__(self, file_path, simulation_type, model_properties):
|
11
|
-
"""
|
12
|
-
Initializes the TurbulencePropertiesWriter.
|
13
|
-
|
14
|
-
Args:
|
15
|
-
file_path (str): The full path to the output file 'turbulenceProperties'.
|
16
|
-
simulation_type (str): The top-level simulation type (e.g., 'RAS', 'LES', 'laminar').
|
17
|
-
model_properties (dict): A dictionary containing the properties for the chosen model.
|
18
|
-
This dictionary can be nested.
|
19
|
-
"""
|
20
|
-
super().__init__(file_path, simulation_type, model_properties)
|
21
|
-
|
22
|
-
def validate_simulation_type(self):
|
23
|
-
"""
|
24
|
-
Validates the simulation type.
|
25
|
-
|
26
|
-
Returns:
|
27
|
-
bool: True if validation passes, False otherwise.
|
28
|
-
"""
|
29
|
-
valid_types = ['RAS', 'LES', 'laminar']
|
30
|
-
|
31
|
-
if self.simulation_type not in valid_types:
|
32
|
-
print(f"Warning: Invalid simulation type '{self.simulation_type}'. Valid types: {valid_types}")
|
33
|
-
return False
|
34
|
-
|
35
|
-
return True
|
36
|
-
|
37
|
-
def validate_model_properties(self):
|
38
|
-
"""
|
39
|
-
Validates the model properties based on simulation type.
|
40
|
-
|
41
|
-
Returns:
|
42
|
-
bool: True if validation passes, False otherwise.
|
43
|
-
"""
|
44
|
-
if self.simulation_type == 'RAS':
|
45
|
-
required_keys = ['RASModel', 'turbulence']
|
46
|
-
for key in required_keys:
|
47
|
-
if key not in self.model_properties:
|
48
|
-
print(f"Warning: Required RAS parameter '{key}' is missing.")
|
49
|
-
return False
|
50
|
-
|
51
|
-
# Validate RAS model
|
52
|
-
valid_ras_models = ['kEpsilon', 'realizableKE', 'kOmegaSST', 'SpalartAllmaras']
|
53
|
-
if self.model_properties.get('RASModel') not in valid_ras_models:
|
54
|
-
print(f"Warning: Unknown RAS model '{self.model_properties.get('RASModel')}'.")
|
55
|
-
|
56
|
-
elif self.simulation_type == 'LES':
|
57
|
-
required_keys = ['LESModel', 'turbulence']
|
58
|
-
for key in required_keys:
|
59
|
-
if key not in self.model_properties:
|
60
|
-
print(f"Warning: Required LES parameter '{key}' is missing.")
|
61
|
-
return False
|
62
|
-
|
63
|
-
# Validate LES model
|
64
|
-
valid_les_models = ['Smagorinsky', 'kEqn', 'WALE', 'dynamicKEqn']
|
65
|
-
if self.model_properties.get('LESModel') not in valid_les_models:
|
66
|
-
print(f"Warning: Unknown LES model '{self.model_properties.get('LESModel')}'.")
|
67
|
-
|
68
|
-
return True
|
pycphy-0.1.0.dist-info/RECORD
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
pycphy/__init__.py,sha256=Mm71OUIMs3Eex9oxoNeLft7189a-eHollog8-JomGlc,544
|
2
|
-
pycphy/foamCaseDeveloper/__init__.py,sha256=gzvozQIRG8Zktkd9snAPfJhV28Qg8yazh0rZOX6et40,874
|
3
|
-
pycphy/foamCaseDeveloper/main.py,sha256=CsAkeZzNREGRcsSDqPgP9tlTAtz7QnPkkB59T1QfkT8,8932
|
4
|
-
pycphy/foamCaseDeveloper/config/__init__.py,sha256=6_sGyfn-lC9QYXHSdmRS2F6ObfU5okh_uioaiK6jf6w,816
|
5
|
-
pycphy/foamCaseDeveloper/config/block_mesh_config.py,sha256=9QfcdXxPMtazwjgv4Twjp0fp-hder-fSXV0KQXi4kM8,3694
|
6
|
-
pycphy/foamCaseDeveloper/config/control_config.py,sha256=LMsB9KG7yniOfKiMnF7ZVtMYZ9v9lXnObxWnuumIkns,7799
|
7
|
-
pycphy/foamCaseDeveloper/config/global_config.py,sha256=RgUUYCidlzuTRMgiswDQ69OSQgler9Rz3QZzSP1vw2g,2988
|
8
|
-
pycphy/foamCaseDeveloper/config/turbulence_config.py,sha256=oOmVYHX6A30CSZbb3ichQVnnWRs0krkRRP1UhX_5f1Q,8845
|
9
|
-
pycphy/foamCaseDeveloper/core/__init__.py,sha256=rxxMmWuPtfLfGdQvjNK7lDVzNoYZ-E57zucwv-NSiPg,552
|
10
|
-
pycphy/foamCaseDeveloper/core/block_mesh_developer.py,sha256=17u-OLrVzFMM9LshdMusLCfyIh3ICgFpvYBolLuJliw,3602
|
11
|
-
pycphy/foamCaseDeveloper/core/control_dict_writer.py,sha256=ae91vhJ5dIzgozMjADHxWWmJoqXTgRgfGQEDsOAfML0,2067
|
12
|
-
pycphy/foamCaseDeveloper/core/foam_case_manager.py,sha256=tvSStP7F27e8su8FM_MyjvL1iBWiwUS71yeVkArZIJw,7315
|
13
|
-
pycphy/foamCaseDeveloper/core/turbulence_properties_writer.py,sha256=7XnDUqhNu5XTdXN1thvVjGV-yuTlStCpegc73FM4t-c,2938
|
14
|
-
pycphy/foamCaseDeveloper/writers/__init__.py,sha256=GNcGirRv_HBosXMmatN78i5pI5_kaMt1ewwXiJMq2fA,508
|
15
|
-
pycphy/foamCaseDeveloper/writers/block_mesh_writer.py,sha256=lirGHOBlCjX_aaSCsCkWDPAjkki7QJBemPz6yVA7Q-g,4877
|
16
|
-
pycphy/foamCaseDeveloper/writers/control_dict_writer.py,sha256=gaDls-kvqfv_KzG6Ac_2IbIByQ45-6Sn1ylcfIVHiig,1908
|
17
|
-
pycphy/foamCaseDeveloper/writers/foam_writer.py,sha256=KMfQ-338UUg6mEIyW_-55DbcK5UHVihqOXYT0BSsA1M,2854
|
18
|
-
pycphy/foamCaseDeveloper/writers/turbulence_properties_writer.py,sha256=gdUqC_snJLEt8PSwC6TNEUYXCFIneVwm9W4fH8LEqLY,3331
|
19
|
-
pycphy-0.1.0.dist-info/licenses/LICENSE,sha256=SO-nbkWPNmUErH6Zw-SxD-3bGgO9j9euAnYU8K6Gjeo,1093
|
20
|
-
pycphy-0.1.0.dist-info/METADATA,sha256=iOkI2_8BNtIteOj1iKUR16kZ2j3VrAJxEOOKYjdef1o,9698
|
21
|
-
pycphy-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
22
|
-
pycphy-0.1.0.dist-info/entry_points.txt,sha256=i_F-4TnLFt1X-jvnQgRbStMs-pZY5oXlfnc6Nr3wI_k,67
|
23
|
-
pycphy-0.1.0.dist-info/top_level.txt,sha256=w2z-jwGibnt6eh8y4z7LvsPL6I2196b8m_Jxl0XB3PM,7
|
24
|
-
pycphy-0.1.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|