ansys-fluent-core 0.29.dev0__py3-none-any.whl → 0.29.dev2__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.
Potentially problematic release.
This version of ansys-fluent-core might be problematic. Click here for more details.
- ansys/fluent/core/__init__.py +1 -1
- ansys/fluent/core/_version.py +2 -2
- ansys/fluent/core/codegen/tuigen.py +1 -1
- ansys/fluent/core/codegen/walk_api.py +45 -18
- ansys/fluent/core/generated/api_tree/api_objects.json +1 -1
- ansys/fluent/core/generated/datamodel_252/meshing.py +1 -0
- ansys/fluent/core/generated/datamodel_252/preferences.py +7 -0
- ansys/fluent/core/generated/fluent_version_252.py +3 -3
- ansys/fluent/core/generated/meshing/tui_252.py +395 -390
- ansys/fluent/core/generated/solver/settings_252.py +782 -306
- ansys/fluent/core/generated/solver/settings_252.pyi +442 -133
- ansys/fluent/core/generated/solver/tui_252.py +4046 -3737
- ansys/fluent/core/launcher/container_launcher.py +4 -3
- ansys/fluent/core/launcher/fluent_container.py +22 -19
- ansys/fluent/core/launcher/launcher.py +2 -2
- ansys/fluent/core/launcher/pim_launcher.py +2 -2
- ansys/fluent/core/launcher/slurm_launcher.py +2 -2
- ansys/fluent/core/launcher/standalone_launcher.py +2 -2
- ansys/fluent/core/logging.py +2 -0
- ansys/fluent/core/logging_config.yaml +3 -0
- ansys/fluent/core/services/app_utilities.py +2 -1
- ansys/fluent/core/services/datamodel_se.py +141 -61
- ansys/fluent/core/services/field_data.py +252 -0
- ansys/fluent/core/services/interceptors.py +28 -2
- ansys/fluent/core/session.py +7 -2
- ansys/fluent/core/session_solver.py +21 -0
- ansys/fluent/core/streaming_services/datamodel_event_streaming.py +12 -12
- {ansys_fluent_core-0.29.dev0.dist-info → ansys_fluent_core-0.29.dev2.dist-info}/LICENSE +1 -1
- {ansys_fluent_core-0.29.dev0.dist-info → ansys_fluent_core-0.29.dev2.dist-info}/METADATA +53 -31
- {ansys_fluent_core-0.29.dev0.dist-info → ansys_fluent_core-0.29.dev2.dist-info}/RECORD +65 -141
- {ansys_fluent_core-0.29.dev0.dist-info → ansys_fluent_core-0.29.dev2.dist-info}/WHEEL +1 -1
- ansys/fluent/core/docs/README.rst +0 -155
- ansys/fluent/tests/conftest.py +0 -415
- ansys/fluent/tests/fluent_fixtures.py +0 -195
- ansys/fluent/tests/integration/test_optislang/test_optislang_integration.py +0 -263
- ansys/fluent/tests/parametric/test_local_parametric_run.py +0 -36
- ansys/fluent/tests/parametric/test_local_parametric_setup.py +0 -34
- ansys/fluent/tests/parametric/test_parametric_workflow.py +0 -279
- ansys/fluent/tests/test_aero_session.py +0 -88
- ansys/fluent/tests/test_batch_ops.py +0 -39
- ansys/fluent/tests/test_builtin_settings.py +0 -761
- ansys/fluent/tests/test_cad_to_post_ftm.py +0 -525
- ansys/fluent/tests/test_cad_to_post_wtm.py +0 -250
- ansys/fluent/tests/test_casereader.py +0 -324
- ansys/fluent/tests/test_codegen.py +0 -783
- ansys/fluent/tests/test_creatable.py +0 -31
- ansys/fluent/tests/test_data_model_cache.py +0 -434
- ansys/fluent/tests/test_datamodel_api.py +0 -449
- ansys/fluent/tests/test_datamodel_service.py +0 -814
- ansys/fluent/tests/test_datareader.py +0 -103
- ansys/fluent/tests/test_error_handling.py +0 -24
- ansys/fluent/tests/test_events_manager.py +0 -214
- ansys/fluent/tests/test_field_data.py +0 -466
- ansys/fluent/tests/test_file_session.py +0 -355
- ansys/fluent/tests/test_file_transfer_service.py +0 -165
- ansys/fluent/tests/test_fix_doc.py +0 -29
- ansys/fluent/tests/test_flobject.py +0 -1235
- ansys/fluent/tests/test_fluent_fixes.py +0 -106
- ansys/fluent/tests/test_fluent_session.py +0 -270
- ansys/fluent/tests/test_fluent_version.py +0 -66
- ansys/fluent/tests/test_fluent_version_marker.py +0 -65
- ansys/fluent/tests/test_icing_session.py +0 -9
- ansys/fluent/tests/test_launcher.py +0 -529
- ansys/fluent/tests/test_launcher_remote.py +0 -272
- ansys/fluent/tests/test_lispy.py +0 -40
- ansys/fluent/tests/test_logging.py +0 -16
- ansys/fluent/tests/test_mapped_api.py +0 -774
- ansys/fluent/tests/test_meshing_utilities.py +0 -2436
- ansys/fluent/tests/test_meshing_workflow.py +0 -421
- ansys/fluent/tests/test_meshingmode/test_meshing_launch.py +0 -168
- ansys/fluent/tests/test_new_meshing_workflow.py +0 -1801
- ansys/fluent/tests/test_preferences.py +0 -89
- ansys/fluent/tests/test_pure_mesh_vs_mesh_workflow.py +0 -101
- ansys/fluent/tests/test_reduction.py +0 -484
- ansys/fluent/tests/test_rp_vars.py +0 -77
- ansys/fluent/tests/test_scheduler.py +0 -471
- ansys/fluent/tests/test_scheme_eval_222.py +0 -338
- ansys/fluent/tests/test_scheme_eval_231.py +0 -243
- ansys/fluent/tests/test_search.py +0 -344
- ansys/fluent/tests/test_session.py +0 -594
- ansys/fluent/tests/test_settings_api.py +0 -606
- ansys/fluent/tests/test_settings_reader.py +0 -85
- ansys/fluent/tests/test_slurm_future.py +0 -67
- ansys/fluent/tests/test_solution_variables.py +0 -241
- ansys/fluent/tests/test_solver_monitors.py +0 -83
- ansys/fluent/tests/test_solvermode/boundaries_periodic_expDict +0 -1712
- ansys/fluent/tests/test_solvermode/test_boundaries.py +0 -127
- ansys/fluent/tests/test_solvermode/test_calculationactivities.py +0 -20
- ansys/fluent/tests/test_solvermode/test_controls.py +0 -131
- ansys/fluent/tests/test_solvermode/test_general.py +0 -109
- ansys/fluent/tests/test_solvermode/test_initialization.py +0 -83
- ansys/fluent/tests/test_solvermode/test_materials.py +0 -40
- ansys/fluent/tests/test_solvermode/test_methods.py +0 -65
- ansys/fluent/tests/test_solvermode/test_models.py +0 -99
- ansys/fluent/tests/test_solvermode/test_named_expressions.py +0 -35
- ansys/fluent/tests/test_solvermode/test_post_vector.py +0 -22
- ansys/fluent/tests/test_solvermode/test_species_model.py +0 -67
- ansys/fluent/tests/test_streaming_services.py +0 -52
- ansys/fluent/tests/test_systemcoupling.py +0 -44
- ansys/fluent/tests/test_topy.py +0 -179
- ansys/fluent/tests/test_tui_api.py +0 -70
- ansys/fluent/tests/test_type_stub.py +0 -37
- ansys/fluent/tests/test_utils.py +0 -82
- ansys/fluent/tests/util/__init__.py +0 -36
- ansys/fluent/tests/util/meshing_workflow.py +0 -33
- ansys/fluent/tests/util/solver.py +0 -72
- ansys_fluent_core-0.29.dev0.dist-info/AUTHORS +0 -12
|
@@ -1,525 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
End-to-end Fluent Solver Workflow using Fault Tolerant Meshing
|
|
3
|
-
------------------------------------------------------------------
|
|
4
|
-
|
|
5
|
-
This test covers the setup and solution of a three-dimensional
|
|
6
|
-
turbulent fluid flow in a manifold exhaust system using fault
|
|
7
|
-
tolerant meshing workflow.
|
|
8
|
-
|
|
9
|
-
This test queries the following using PyTest:
|
|
10
|
-
|
|
11
|
-
- Meshing workflow tasks state before and after the task execution
|
|
12
|
-
- Report definitions check after solution
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
from functools import partial
|
|
16
|
-
|
|
17
|
-
import pytest
|
|
18
|
-
from util.meshing_workflow import ( # noqa: F401
|
|
19
|
-
assign_task_arguments,
|
|
20
|
-
execute_task_with_pre_and_postcondition_checks,
|
|
21
|
-
)
|
|
22
|
-
from util.solver import check_report_definition_result
|
|
23
|
-
|
|
24
|
-
from ansys.fluent.core.utils.fluent_version import FluentVersion
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
@pytest.mark.nightly
|
|
28
|
-
@pytest.mark.codegen_required
|
|
29
|
-
def test_exhaust_system(
|
|
30
|
-
fault_tolerant_workflow_session, exhaust_system_geometry_filename
|
|
31
|
-
):
|
|
32
|
-
meshing_session = fault_tolerant_workflow_session
|
|
33
|
-
workflow = meshing_session.workflow
|
|
34
|
-
|
|
35
|
-
_ = partial(assign_task_arguments, workflow=workflow, check_state=True)
|
|
36
|
-
|
|
37
|
-
execute_task_with_pre_and_postconditions = partial(
|
|
38
|
-
execute_task_with_pre_and_postcondition_checks, workflow=workflow
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
###############################################################################
|
|
42
|
-
# Import the CAD geometry
|
|
43
|
-
meshing_session.PartManagement.InputFileChanged(
|
|
44
|
-
FilePath=exhaust_system_geometry_filename,
|
|
45
|
-
IgnoreSolidNames=False,
|
|
46
|
-
PartPerBody=False,
|
|
47
|
-
)
|
|
48
|
-
meshing_session.PMFileManagement.FileManager.LoadFiles()
|
|
49
|
-
meshing_session.PartManagement.Node["Meshing Model"].Copy(
|
|
50
|
-
Paths=[
|
|
51
|
-
"/dirty_manifold-for-wrapper," + "1/dirty_manifold-for-wrapper,1/main,1",
|
|
52
|
-
"/dirty_manifold-for-wrapper,"
|
|
53
|
-
+ "1/dirty_manifold-for-wrapper,1/flow-pipe,1",
|
|
54
|
-
"/dirty_manifold-for-wrapper,"
|
|
55
|
-
+ "1/dirty_manifold-for-wrapper,1/outpipe3,1",
|
|
56
|
-
"/dirty_manifold-for-wrapper," + "1/dirty_manifold-for-wrapper,1/object2,1",
|
|
57
|
-
"/dirty_manifold-for-wrapper," + "1/dirty_manifold-for-wrapper,1/object1,1",
|
|
58
|
-
]
|
|
59
|
-
)
|
|
60
|
-
meshing_session.PartManagement.ObjectSetting[
|
|
61
|
-
"DefaultObjectSetting"
|
|
62
|
-
].OneZonePer.setState("part")
|
|
63
|
-
workflow.TaskObject["Import CAD and Part Management"].Arguments.setState(
|
|
64
|
-
{
|
|
65
|
-
"Context": 0,
|
|
66
|
-
"CreateObjectPer": "Custom",
|
|
67
|
-
"FMDFileName": exhaust_system_geometry_filename,
|
|
68
|
-
"FileLoaded": "yes",
|
|
69
|
-
"ObjectSetting": "DefaultObjectSetting",
|
|
70
|
-
"Options": {
|
|
71
|
-
"Line": False,
|
|
72
|
-
"Solid": False,
|
|
73
|
-
"Surface": False,
|
|
74
|
-
},
|
|
75
|
-
}
|
|
76
|
-
)
|
|
77
|
-
execute_task_with_pre_and_postconditions(task_name="Import CAD and Part Management")
|
|
78
|
-
|
|
79
|
-
###############################################################################
|
|
80
|
-
# Provide a description for the geometry and the flow characteristics.
|
|
81
|
-
describe_geo = workflow.TaskObject["Describe Geometry and Flow"]
|
|
82
|
-
describe_geo.Arguments.setState(
|
|
83
|
-
{
|
|
84
|
-
"AddEnclosure": "No",
|
|
85
|
-
"CloseCaps": "Yes",
|
|
86
|
-
"FlowType": "Internal flow through the object",
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
describe_geo.UpdateChildTasks(SetupTypeChanged=False)
|
|
90
|
-
describe_geo.Arguments.setState(
|
|
91
|
-
{
|
|
92
|
-
"AddEnclosure": "No",
|
|
93
|
-
"CloseCaps": "Yes",
|
|
94
|
-
"DescribeGeometryAndFlowOptions": {
|
|
95
|
-
"AdvancedOptions": True,
|
|
96
|
-
"ExtractEdgeFeatures": "Yes",
|
|
97
|
-
},
|
|
98
|
-
"FlowType": "Internal flow through the object",
|
|
99
|
-
}
|
|
100
|
-
)
|
|
101
|
-
describe_geo.UpdateChildTasks(SetupTypeChanged=False)
|
|
102
|
-
execute_task_with_pre_and_postconditions(task_name="Describe Geometry and Flow")
|
|
103
|
-
|
|
104
|
-
###############################################################################
|
|
105
|
-
# Cover any openings in your geometry.
|
|
106
|
-
capping = workflow.TaskObject["Enclose Fluid Regions (Capping)"]
|
|
107
|
-
capping.Arguments.setState(
|
|
108
|
-
{
|
|
109
|
-
"CreatePatchPreferences": {
|
|
110
|
-
"ShowCreatePatchPreferences": False,
|
|
111
|
-
},
|
|
112
|
-
"PatchName": "inlet-1",
|
|
113
|
-
"SelectionType": "zone",
|
|
114
|
-
"ZoneSelectionList": ["inlet.1"],
|
|
115
|
-
}
|
|
116
|
-
)
|
|
117
|
-
capping.Arguments.setState(
|
|
118
|
-
{
|
|
119
|
-
"CreatePatchPreferences": {
|
|
120
|
-
"ShowCreatePatchPreferences": False,
|
|
121
|
-
},
|
|
122
|
-
"PatchName": "inlet-1",
|
|
123
|
-
"SelectionType": "zone",
|
|
124
|
-
"ZoneLocation": [
|
|
125
|
-
"1",
|
|
126
|
-
"351.68205",
|
|
127
|
-
"-361.34322",
|
|
128
|
-
"-301.88668",
|
|
129
|
-
"396.96205",
|
|
130
|
-
"-332.84759",
|
|
131
|
-
"-266.69751",
|
|
132
|
-
"inlet.1",
|
|
133
|
-
],
|
|
134
|
-
"ZoneSelectionList": ["inlet.1"],
|
|
135
|
-
}
|
|
136
|
-
)
|
|
137
|
-
capping.AddChildToTask()
|
|
138
|
-
capping.InsertCompoundChildTask()
|
|
139
|
-
capping.Arguments.setState({})
|
|
140
|
-
execute_task_with_pre_and_postconditions(task_name="inlet-1")
|
|
141
|
-
capping.Arguments.setState(
|
|
142
|
-
{
|
|
143
|
-
"PatchName": "inlet-2",
|
|
144
|
-
"SelectionType": "zone",
|
|
145
|
-
"ZoneSelectionList": ["inlet.2"],
|
|
146
|
-
}
|
|
147
|
-
)
|
|
148
|
-
capping.Arguments.setState(
|
|
149
|
-
{
|
|
150
|
-
"PatchName": "inlet-2",
|
|
151
|
-
"SelectionType": "zone",
|
|
152
|
-
"ZoneLocation": [
|
|
153
|
-
"1",
|
|
154
|
-
"441.68205",
|
|
155
|
-
"-361.34322",
|
|
156
|
-
"-301.88668",
|
|
157
|
-
"486.96205",
|
|
158
|
-
"-332.84759",
|
|
159
|
-
"-266.69751",
|
|
160
|
-
"inlet.2",
|
|
161
|
-
],
|
|
162
|
-
"ZoneSelectionList": ["inlet.2"],
|
|
163
|
-
}
|
|
164
|
-
)
|
|
165
|
-
capping.AddChildToTask()
|
|
166
|
-
capping.InsertCompoundChildTask()
|
|
167
|
-
capping.Arguments.setState({})
|
|
168
|
-
execute_task_with_pre_and_postconditions(task_name="inlet-2")
|
|
169
|
-
capping.Arguments.setState(
|
|
170
|
-
{
|
|
171
|
-
"PatchName": "inlet-3",
|
|
172
|
-
"SelectionType": "zone",
|
|
173
|
-
"ZoneSelectionList": ["inlet"],
|
|
174
|
-
}
|
|
175
|
-
)
|
|
176
|
-
capping.Arguments.setState(
|
|
177
|
-
{
|
|
178
|
-
"PatchName": "inlet-3",
|
|
179
|
-
"SelectionType": "zone",
|
|
180
|
-
"ZoneLocation": [
|
|
181
|
-
"1",
|
|
182
|
-
"261.68205",
|
|
183
|
-
"-361.34322",
|
|
184
|
-
"-301.88668",
|
|
185
|
-
"306.96205",
|
|
186
|
-
"-332.84759",
|
|
187
|
-
"-266.69751",
|
|
188
|
-
"inlet",
|
|
189
|
-
],
|
|
190
|
-
"ZoneSelectionList": ["inlet"],
|
|
191
|
-
}
|
|
192
|
-
)
|
|
193
|
-
capping.AddChildToTask()
|
|
194
|
-
capping.InsertCompoundChildTask()
|
|
195
|
-
capping.Arguments.setState({})
|
|
196
|
-
execute_task_with_pre_and_postconditions(task_name="inlet-3")
|
|
197
|
-
capping.Arguments.setState(
|
|
198
|
-
{
|
|
199
|
-
"PatchName": "outlet-1",
|
|
200
|
-
"SelectionType": "zone",
|
|
201
|
-
"ZoneSelectionList": ["outlet"],
|
|
202
|
-
"ZoneType": "pressure-outlet",
|
|
203
|
-
}
|
|
204
|
-
)
|
|
205
|
-
capping.Arguments.setState(
|
|
206
|
-
{
|
|
207
|
-
"PatchName": "outlet-1",
|
|
208
|
-
"SelectionType": "zone",
|
|
209
|
-
"ZoneLocation": [
|
|
210
|
-
"1",
|
|
211
|
-
"352.22702",
|
|
212
|
-
"-197.8957",
|
|
213
|
-
"84.102381",
|
|
214
|
-
"394.41707",
|
|
215
|
-
"-155.70565",
|
|
216
|
-
"84.102381",
|
|
217
|
-
"outlet",
|
|
218
|
-
],
|
|
219
|
-
"ZoneSelectionList": ["outlet"],
|
|
220
|
-
"ZoneType": "pressure-outlet",
|
|
221
|
-
}
|
|
222
|
-
)
|
|
223
|
-
capping.AddChildToTask()
|
|
224
|
-
capping.InsertCompoundChildTask()
|
|
225
|
-
capping.Arguments.setState({})
|
|
226
|
-
execute_task_with_pre_and_postconditions(task_name="outlet-1")
|
|
227
|
-
|
|
228
|
-
###############################################################################
|
|
229
|
-
# Extract edge features.
|
|
230
|
-
edge_features = workflow.TaskObject["Extract Edge Features"]
|
|
231
|
-
edge_features.Arguments.setState(
|
|
232
|
-
{
|
|
233
|
-
"ExtractMethodType": "Intersection Loops",
|
|
234
|
-
"ObjectSelectionList": ["flow_pipe", "main"],
|
|
235
|
-
}
|
|
236
|
-
)
|
|
237
|
-
edge_features.AddChildToTask()
|
|
238
|
-
edge_features.InsertCompoundChildTask()
|
|
239
|
-
workflow.TaskObject["edge-group-1"].Arguments.setState(
|
|
240
|
-
{
|
|
241
|
-
"ExtractEdgesName": "edge-group-1",
|
|
242
|
-
"ExtractMethodType": "Intersection Loops",
|
|
243
|
-
"ObjectSelectionList": ["flow_pipe", "main"],
|
|
244
|
-
}
|
|
245
|
-
)
|
|
246
|
-
edge_features.Arguments.setState({})
|
|
247
|
-
execute_task_with_pre_and_postconditions(task_name="edge-group-1")
|
|
248
|
-
|
|
249
|
-
###############################################################################
|
|
250
|
-
# Identify regions.
|
|
251
|
-
region_id = workflow.TaskObject["Identify Regions"]
|
|
252
|
-
region_id.Arguments.setState(
|
|
253
|
-
{
|
|
254
|
-
"SelectionType": "zone",
|
|
255
|
-
"X": 377.322045740589,
|
|
256
|
-
"Y": -176.800676988458,
|
|
257
|
-
"Z": -37.0764628583475,
|
|
258
|
-
"ZoneSelectionList": ["main.1"],
|
|
259
|
-
}
|
|
260
|
-
)
|
|
261
|
-
region_id.Arguments.setState(
|
|
262
|
-
{
|
|
263
|
-
"SelectionType": "zone",
|
|
264
|
-
"X": 377.322045740589,
|
|
265
|
-
"Y": -176.800676988458,
|
|
266
|
-
"Z": -37.0764628583475,
|
|
267
|
-
"ZoneLocation": [
|
|
268
|
-
"1",
|
|
269
|
-
"213.32205",
|
|
270
|
-
"-225.28068",
|
|
271
|
-
"-158.25531",
|
|
272
|
-
"541.32205",
|
|
273
|
-
"-128.32068",
|
|
274
|
-
"84.102381",
|
|
275
|
-
"main.1",
|
|
276
|
-
],
|
|
277
|
-
"ZoneSelectionList": ["main.1"],
|
|
278
|
-
}
|
|
279
|
-
)
|
|
280
|
-
region_id.AddChildToTask()
|
|
281
|
-
region_id.InsertCompoundChildTask()
|
|
282
|
-
workflow.TaskObject["fluid-region-1"].Arguments.setState(
|
|
283
|
-
{
|
|
284
|
-
"MaterialPointsName": "fluid-region-1",
|
|
285
|
-
"SelectionType": "zone",
|
|
286
|
-
"X": 377.322045740589,
|
|
287
|
-
"Y": -176.800676988458,
|
|
288
|
-
"Z": -37.0764628583475,
|
|
289
|
-
"ZoneLocation": [
|
|
290
|
-
"1",
|
|
291
|
-
"213.32205",
|
|
292
|
-
"-225.28068",
|
|
293
|
-
"-158.25531",
|
|
294
|
-
"541.32205",
|
|
295
|
-
"-128.32068",
|
|
296
|
-
"84.102381",
|
|
297
|
-
"main.1",
|
|
298
|
-
],
|
|
299
|
-
"ZoneSelectionList": ["main.1"],
|
|
300
|
-
}
|
|
301
|
-
)
|
|
302
|
-
region_id.Arguments.setState({})
|
|
303
|
-
execute_task_with_pre_and_postconditions(task_name="fluid-region-1")
|
|
304
|
-
region_id.Arguments.setState(
|
|
305
|
-
{
|
|
306
|
-
"MaterialPointsName": "void-region-1",
|
|
307
|
-
"NewRegionType": "void",
|
|
308
|
-
"ObjectSelectionList": ["inlet-1", "inlet-2", "inlet-3", "main"],
|
|
309
|
-
"X": 374.722045740589,
|
|
310
|
-
"Y": -278.9775145640143,
|
|
311
|
-
"Z": -161.1700719416913,
|
|
312
|
-
}
|
|
313
|
-
)
|
|
314
|
-
region_id.AddChildToTask()
|
|
315
|
-
region_id.InsertCompoundChildTask()
|
|
316
|
-
region_id.Arguments.setState({})
|
|
317
|
-
execute_task_with_pre_and_postconditions(task_name="void-region-1")
|
|
318
|
-
|
|
319
|
-
###############################################################################
|
|
320
|
-
# Define thresholds for any potential leakages.
|
|
321
|
-
leakage_threshold = workflow.TaskObject["Define Leakage Threshold"]
|
|
322
|
-
leakage_threshold.Arguments.setState(
|
|
323
|
-
{
|
|
324
|
-
"AddChild": "yes",
|
|
325
|
-
"FlipDirection": True,
|
|
326
|
-
"PlaneDirection": "X",
|
|
327
|
-
"RegionSelectionSingle": "void-region-1",
|
|
328
|
-
}
|
|
329
|
-
)
|
|
330
|
-
leakage_threshold.AddChildToTask()
|
|
331
|
-
leakage_threshold.InsertCompoundChildTask()
|
|
332
|
-
workflow.TaskObject["leakage-1"].Arguments.setState(
|
|
333
|
-
{
|
|
334
|
-
"AddChild": "yes",
|
|
335
|
-
"FlipDirection": True,
|
|
336
|
-
"LeakageName": "leakage-1",
|
|
337
|
-
"PlaneDirection": "X",
|
|
338
|
-
"RegionSelectionSingle": "void-region-1",
|
|
339
|
-
}
|
|
340
|
-
)
|
|
341
|
-
leakage_threshold.Arguments.setState(
|
|
342
|
-
{
|
|
343
|
-
"AddChild": "yes",
|
|
344
|
-
}
|
|
345
|
-
)
|
|
346
|
-
execute_task_with_pre_and_postconditions(task_name="leakage-1")
|
|
347
|
-
|
|
348
|
-
###############################################################################
|
|
349
|
-
# Review your region settings.
|
|
350
|
-
workflow.TaskObject["Update Region Settings"].Arguments.setState(
|
|
351
|
-
{
|
|
352
|
-
"AllRegionFilterCategories": ["2"] * 5 + ["1"] * 2,
|
|
353
|
-
"AllRegionLeakageSizeList": ["none"] * 6 + ["6.4"],
|
|
354
|
-
"AllRegionLinkedConstructionSurfaceList": ["n/a"] * 6 + ["no"],
|
|
355
|
-
"AllRegionMeshMethodList": ["none"] * 6 + ["wrap"],
|
|
356
|
-
"AllRegionNameList": [
|
|
357
|
-
"main",
|
|
358
|
-
"flow_pipe",
|
|
359
|
-
"outpipe3",
|
|
360
|
-
"object2",
|
|
361
|
-
"object1",
|
|
362
|
-
"void-region-1",
|
|
363
|
-
"fluid-region-1",
|
|
364
|
-
],
|
|
365
|
-
"AllRegionOversetComponenList": ["no"] * 7,
|
|
366
|
-
"AllRegionSourceList": ["object"] * 5 + ["mpt"] * 2,
|
|
367
|
-
"AllRegionTypeList": ["void"] * 6 + ["fluid"],
|
|
368
|
-
"AllRegionVolumeFillList": ["none"] * 6 + ["tet"],
|
|
369
|
-
"FilterCategory": "Identified Regions",
|
|
370
|
-
"OldRegionLeakageSizeList": [""],
|
|
371
|
-
"OldRegionMeshMethodList": ["wrap"],
|
|
372
|
-
"OldRegionNameList": ["fluid-region-1"],
|
|
373
|
-
"OldRegionOversetComponenList": ["no"],
|
|
374
|
-
"OldRegionTypeList": ["fluid"],
|
|
375
|
-
"OldRegionVolumeFillList": ["hexcore"],
|
|
376
|
-
"RegionLeakageSizeList": [""],
|
|
377
|
-
"RegionMeshMethodList": ["wrap"],
|
|
378
|
-
"RegionNameList": ["fluid-region-1"],
|
|
379
|
-
"RegionOversetComponenList": ["no"],
|
|
380
|
-
"RegionTypeList": ["fluid"],
|
|
381
|
-
"RegionVolumeFillList": ["tet"],
|
|
382
|
-
}
|
|
383
|
-
)
|
|
384
|
-
execute_task_with_pre_and_postconditions(task_name="Update Region Settings")
|
|
385
|
-
|
|
386
|
-
###############################################################################
|
|
387
|
-
# Select options for controlling the mesh.
|
|
388
|
-
execute_task_with_pre_and_postconditions(task_name="Choose Mesh Control Options")
|
|
389
|
-
|
|
390
|
-
###############################################################################
|
|
391
|
-
# Generate the surface mesh.
|
|
392
|
-
execute_task_with_pre_and_postconditions(task_name="Generate the Surface Mesh")
|
|
393
|
-
|
|
394
|
-
###############################################################################
|
|
395
|
-
# Confirm and update the boundaries.
|
|
396
|
-
execute_task_with_pre_and_postconditions(task_name="Update Boundaries")
|
|
397
|
-
|
|
398
|
-
###############################################################################
|
|
399
|
-
# Add boundary layers.
|
|
400
|
-
add_boundary_layer = workflow.TaskObject["Add Boundary Layers"]
|
|
401
|
-
add_boundary_layer.AddChildToTask()
|
|
402
|
-
add_boundary_layer.InsertCompoundChildTask()
|
|
403
|
-
workflow.TaskObject["aspect-ratio_1"].Arguments.setState(
|
|
404
|
-
{
|
|
405
|
-
"BLControlName": "aspect-ratio_1",
|
|
406
|
-
}
|
|
407
|
-
)
|
|
408
|
-
add_boundary_layer.Arguments.setState({})
|
|
409
|
-
execute_task_with_pre_and_postconditions(task_name="aspect-ratio_1")
|
|
410
|
-
|
|
411
|
-
###############################################################################
|
|
412
|
-
# Generate the volume mesh.
|
|
413
|
-
workflow.TaskObject["Generate the Volume Mesh"].Arguments.setState(
|
|
414
|
-
{
|
|
415
|
-
"AllRegionNameList": [
|
|
416
|
-
"main",
|
|
417
|
-
"flow_pipe",
|
|
418
|
-
"outpipe3",
|
|
419
|
-
"object2",
|
|
420
|
-
"object1",
|
|
421
|
-
"void-region-1",
|
|
422
|
-
"fluid-region-1",
|
|
423
|
-
],
|
|
424
|
-
"AllRegionSizeList": ["11.33375"] * 7,
|
|
425
|
-
"AllRegionVolumeFillList": ["none"] * 6 + ["tet"],
|
|
426
|
-
"EnableParallel": True,
|
|
427
|
-
}
|
|
428
|
-
)
|
|
429
|
-
execute_task_with_pre_and_postconditions(task_name="Generate the Volume Mesh")
|
|
430
|
-
|
|
431
|
-
###############################################################################
|
|
432
|
-
# Check the mesh in Meshing mode
|
|
433
|
-
# TODO: Remove the if condition after a stable version of 23.1 is available and update the commands as required.
|
|
434
|
-
if meshing_session.get_fluent_version() < FluentVersion.v231:
|
|
435
|
-
meshing_session.tui.mesh.check_mesh()
|
|
436
|
-
|
|
437
|
-
###############################################################################
|
|
438
|
-
# Switch to Solution mode
|
|
439
|
-
solver_session = meshing_session.switch_to_solver()
|
|
440
|
-
tui = solver_session.tui
|
|
441
|
-
###############################################################################
|
|
442
|
-
# Check the mesh in Solver mode
|
|
443
|
-
tui.mesh.check()
|
|
444
|
-
|
|
445
|
-
###############################################################################
|
|
446
|
-
# Set the units for length
|
|
447
|
-
tui.define.units("length", "mm")
|
|
448
|
-
|
|
449
|
-
###############################################################################
|
|
450
|
-
# Select kw sst turbulence model
|
|
451
|
-
tui.define.models.viscous.kw_sst("yes")
|
|
452
|
-
|
|
453
|
-
###############################################################################
|
|
454
|
-
# Set the velocity and turbulence boundary conditions for the first inlet
|
|
455
|
-
# (inlet-1).
|
|
456
|
-
# TODO: Remove the if condition after a stable version of 23.1 is available and update the commands as required.
|
|
457
|
-
if solver_session.get_fluent_version() < FluentVersion.v231:
|
|
458
|
-
boundary_conditions = tui.define.boundary_conditions
|
|
459
|
-
boundary_conditions.set.velocity_inlet("inlet-1", [], "vmag", "no", 1, "quit")
|
|
460
|
-
###############################################################################
|
|
461
|
-
# Apply the same conditions for the other velocity inlet boundaries (inlet_2,
|
|
462
|
-
# and inlet_3).
|
|
463
|
-
boundary_conditions.copy_bc("inlet-1", "inlet-2", "inlet-3", ())
|
|
464
|
-
|
|
465
|
-
###############################################################################
|
|
466
|
-
# Set the boundary conditions at the outlet (outlet-1).
|
|
467
|
-
boundary_conditions.set.pressure_outlet(
|
|
468
|
-
"outlet-1", [], "turb-intensity", 5, "quit"
|
|
469
|
-
)
|
|
470
|
-
tui.solve.monitors.residual.plot("yes")
|
|
471
|
-
|
|
472
|
-
###############################################################################
|
|
473
|
-
# Initialize the flow field using the Initialization
|
|
474
|
-
tui.solve.initialize.hyb_initialization()
|
|
475
|
-
|
|
476
|
-
###############################################################################
|
|
477
|
-
# Start the calculation by requesting 100 iterations
|
|
478
|
-
tui.solve.set.number_of_iterations(100)
|
|
479
|
-
tui.solve.iterate()
|
|
480
|
-
|
|
481
|
-
###############################################################################
|
|
482
|
-
# Assert the returned mass flow rate report definition value
|
|
483
|
-
flux = solver_session.solution.report_definitions.flux
|
|
484
|
-
flux["mass_flow_rate"] = {}
|
|
485
|
-
flux["mass_flow_rate"].zone_names = [
|
|
486
|
-
"inlet-1",
|
|
487
|
-
"inlet-2",
|
|
488
|
-
"inlet-3",
|
|
489
|
-
"outlet-1",
|
|
490
|
-
]
|
|
491
|
-
|
|
492
|
-
check_report_definition = partial(
|
|
493
|
-
check_report_definition_result,
|
|
494
|
-
report_definitions=solver_session.solution.report_definitions,
|
|
495
|
-
)
|
|
496
|
-
|
|
497
|
-
check_report_definition(
|
|
498
|
-
report_definition_name="mass_flow_rate",
|
|
499
|
-
expected_result=pytest.approx(-6.036667e-07, abs=1e-3),
|
|
500
|
-
)
|
|
501
|
-
|
|
502
|
-
###############################################################################
|
|
503
|
-
# Assert the returned velocity-magnitude report definition value on the outlet
|
|
504
|
-
# surface
|
|
505
|
-
solver_session.solution.report_definitions.surface[
|
|
506
|
-
"velocity_magnitude_outlet"
|
|
507
|
-
] = {}
|
|
508
|
-
vmag_outlet = solver_session.solution.report_definitions.surface[
|
|
509
|
-
"velocity_magnitude_outlet"
|
|
510
|
-
]
|
|
511
|
-
vmag_outlet.report_type = "surface-areaavg"
|
|
512
|
-
vmag_outlet.field = "velocity-magnitude"
|
|
513
|
-
vmag_outlet.surface_names = ["outlet-1"]
|
|
514
|
-
|
|
515
|
-
check_report_definition = partial(
|
|
516
|
-
check_report_definition_result,
|
|
517
|
-
report_definitions=solver_session.solution.report_definitions,
|
|
518
|
-
)
|
|
519
|
-
|
|
520
|
-
check_report_definition(
|
|
521
|
-
report_definition_name="velocity_magnitude_outlet",
|
|
522
|
-
expected_result=pytest.approx(3.7988207, rel=1e-3),
|
|
523
|
-
)
|
|
524
|
-
|
|
525
|
-
###############################################################################
|