ansys-fluent-core 0.29.dev0__py3-none-any.whl → 0.29.dev1__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.dev1.dist-info}/LICENSE +1 -1
- {ansys_fluent_core-0.29.dev0.dist-info → ansys_fluent_core-0.29.dev1.dist-info}/METADATA +53 -31
- {ansys_fluent_core-0.29.dev0.dist-info → ansys_fluent_core-0.29.dev1.dist-info}/RECORD +65 -141
- {ansys_fluent_core-0.29.dev0.dist-info → ansys_fluent_core-0.29.dev1.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,106 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
from ansys.fluent.core import examples
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@pytest.mark.nightly
|
|
7
|
-
@pytest.mark.fluent_version("==23.2")
|
|
8
|
-
def test_allowed_values_on_report_definitions_1364(new_solver_session):
|
|
9
|
-
solver = new_solver_session
|
|
10
|
-
|
|
11
|
-
import_file_name = examples.download_file(
|
|
12
|
-
"elbow.cas.h5", "pyfluent/examples/DOE-ML-Mixing-Elbow"
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
solver.file.read(
|
|
16
|
-
file_name=import_file_name, file_type="case", lightweight_setup=True
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
report_def = solver.solution.report_definitions.volume.create("xxx")
|
|
20
|
-
|
|
21
|
-
report_def.set_state(
|
|
22
|
-
{
|
|
23
|
-
"report_type": "volume-max",
|
|
24
|
-
"field": "temperature",
|
|
25
|
-
"average_over": 1,
|
|
26
|
-
"per_zone": False,
|
|
27
|
-
"zone_names": ["fluid"],
|
|
28
|
-
"expr_list": None,
|
|
29
|
-
}
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
assert report_def.zone_names.allowed_values() == ["fluid"]
|
|
33
|
-
|
|
34
|
-
assert report_def.expr_list.allowed_values() is None
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
@pytest.mark.fluent_version(">=23.2")
|
|
38
|
-
def test_monitors_list_set_data_637_974_1744_2188(new_solver_session):
|
|
39
|
-
solver_session = new_solver_session
|
|
40
|
-
|
|
41
|
-
import_case = examples.download_file(
|
|
42
|
-
file_name="exhaust_system.cas.h5", directory="pyfluent/exhaust_system"
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
examples.download_file(
|
|
46
|
-
file_name="exhaust_system.dat.h5", directory="pyfluent/exhaust_system"
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
solver_session.file.read_case_data(file_name=import_case)
|
|
50
|
-
solver_session.solution.run_calculation.iterate(iter_count=1)
|
|
51
|
-
|
|
52
|
-
monitors_list = solver_session.monitors.get_monitor_set_names()
|
|
53
|
-
|
|
54
|
-
assert monitors_list == [
|
|
55
|
-
"residual",
|
|
56
|
-
"mass-bal-rplot",
|
|
57
|
-
"mass-tot-rplot",
|
|
58
|
-
"mass-in-rplot",
|
|
59
|
-
"point-vel-rplot",
|
|
60
|
-
]
|
|
61
|
-
|
|
62
|
-
mp = solver_session.monitors.get_monitor_set_data(monitor_set_name="residual")
|
|
63
|
-
|
|
64
|
-
assert mp
|
|
65
|
-
|
|
66
|
-
sample_report_plot = solver_session.solution.monitor.report_plots.create(
|
|
67
|
-
"sample-report-plot"
|
|
68
|
-
)
|
|
69
|
-
sample_report_plot.report_defs = "mass-bal"
|
|
70
|
-
|
|
71
|
-
solver_session.solution.initialization.hybrid_initialize()
|
|
72
|
-
solver_session.solution.run_calculation.iterate(iter_count=1)
|
|
73
|
-
|
|
74
|
-
new_monitors_list = solver_session.monitors.get_monitor_set_names()
|
|
75
|
-
|
|
76
|
-
assert new_monitors_list == [
|
|
77
|
-
"residual",
|
|
78
|
-
"mass-bal-rplot",
|
|
79
|
-
"mass-tot-rplot",
|
|
80
|
-
"mass-in-rplot",
|
|
81
|
-
"point-vel-rplot",
|
|
82
|
-
"sample-report-plot",
|
|
83
|
-
]
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
@pytest.mark.fluent_version(">=24.2")
|
|
87
|
-
def test_empty_vector_field_data_2339(new_solver_session):
|
|
88
|
-
solver = new_solver_session
|
|
89
|
-
|
|
90
|
-
import_case = examples.download_file("mixing_elbow.cas.h5", "pyfluent/mixing_elbow")
|
|
91
|
-
|
|
92
|
-
import_data = examples.download_file("mixing_elbow.dat.h5", "pyfluent/mixing_elbow")
|
|
93
|
-
|
|
94
|
-
assert import_case
|
|
95
|
-
assert import_data
|
|
96
|
-
|
|
97
|
-
solver.file.read_case(file_name=import_case)
|
|
98
|
-
|
|
99
|
-
solver.file.read_data(file_name=import_data)
|
|
100
|
-
|
|
101
|
-
assert [
|
|
102
|
-
a[0]
|
|
103
|
-
for a in solver.fields.field_data.get_vector_field_data(
|
|
104
|
-
field_name="velocity", surfaces=[1]
|
|
105
|
-
)[1]
|
|
106
|
-
][:5]
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import subprocess
|
|
3
|
-
import threading
|
|
4
|
-
import time
|
|
5
|
-
|
|
6
|
-
import pytest
|
|
7
|
-
|
|
8
|
-
import ansys.fluent.core as pyfluent
|
|
9
|
-
from ansys.fluent.core.examples import download_file
|
|
10
|
-
from ansys.fluent.core.fluent_connection import (
|
|
11
|
-
WaitTypeError,
|
|
12
|
-
_pid_exists,
|
|
13
|
-
get_container,
|
|
14
|
-
)
|
|
15
|
-
from ansys.fluent.core.launcher.error_handler import IpPortNotProvided
|
|
16
|
-
from ansys.fluent.core.utils.execution import asynchronous, timeout_loop
|
|
17
|
-
from ansys.fluent.core.utils.fluent_version import FluentVersion
|
|
18
|
-
from docker.models.containers import Container
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def _read_case(session, lightweight_setup=True):
|
|
22
|
-
case_path = download_file("Static_Mixer_main.cas.h5", "pyfluent/static_mixer")
|
|
23
|
-
# Ignore lightweight_setup variable for Fluent < 23.1 because not supported
|
|
24
|
-
if session.get_fluent_version() < FluentVersion.v231:
|
|
25
|
-
session.file.read(file_name=case_path, file_type="case")
|
|
26
|
-
else:
|
|
27
|
-
session.file.read(
|
|
28
|
-
file_name=case_path, file_type="case", lightweight_setup=lightweight_setup
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def test_session_starts_transcript_by_default(new_solver_session) -> None:
|
|
33
|
-
session = new_solver_session
|
|
34
|
-
|
|
35
|
-
def print_transcript(transcript):
|
|
36
|
-
print_transcript.called = True
|
|
37
|
-
if transcript:
|
|
38
|
-
print_transcript.transcript = transcript
|
|
39
|
-
|
|
40
|
-
print_transcript.called = False
|
|
41
|
-
print_transcript.transcript = None
|
|
42
|
-
|
|
43
|
-
session.transcript.register_callback(print_transcript)
|
|
44
|
-
|
|
45
|
-
_read_case(session=session)
|
|
46
|
-
|
|
47
|
-
assert print_transcript.called
|
|
48
|
-
assert print_transcript.transcript
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def test_session_starts_no_transcript_if_disabled(
|
|
52
|
-
new_solver_session,
|
|
53
|
-
) -> None:
|
|
54
|
-
session = new_solver_session
|
|
55
|
-
session.transcript.stop()
|
|
56
|
-
|
|
57
|
-
def print_transcript(transcript):
|
|
58
|
-
print_transcript.called = True
|
|
59
|
-
|
|
60
|
-
print_transcript.called = False
|
|
61
|
-
|
|
62
|
-
session.transcript.start(write_to_stdout=False)
|
|
63
|
-
|
|
64
|
-
_read_case(session=session)
|
|
65
|
-
|
|
66
|
-
assert not print_transcript.called
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
def test_server_exits_when_session_goes_out_of_scope() -> None:
|
|
70
|
-
def f():
|
|
71
|
-
session = pyfluent.launch_fluent()
|
|
72
|
-
session.settings
|
|
73
|
-
_fluent_host_pid = session.connection_properties.fluent_host_pid
|
|
74
|
-
_cortex_host = session.connection_properties.cortex_host
|
|
75
|
-
_inside_container = session.connection_properties.inside_container
|
|
76
|
-
return _fluent_host_pid, _cortex_host, _inside_container
|
|
77
|
-
|
|
78
|
-
fluent_host_pid, cortex_host, inside_container = f()
|
|
79
|
-
|
|
80
|
-
timeout_loop(
|
|
81
|
-
lambda: (inside_container and not get_container(cortex_host))
|
|
82
|
-
or (not inside_container and not _pid_exists(fluent_host_pid)),
|
|
83
|
-
60,
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
if inside_container:
|
|
87
|
-
assert not get_container(cortex_host)
|
|
88
|
-
else:
|
|
89
|
-
assert not _pid_exists(fluent_host_pid)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
def test_server_does_not_exit_when_session_goes_out_of_scope() -> None:
|
|
93
|
-
def f():
|
|
94
|
-
session = pyfluent.launch_fluent(cleanup_on_exit=False)
|
|
95
|
-
session.settings
|
|
96
|
-
_fluent_host_pid = session.connection_properties.fluent_host_pid
|
|
97
|
-
_cortex_host = session.connection_properties.cortex_host
|
|
98
|
-
_inside_container = session.connection_properties.inside_container
|
|
99
|
-
_cortex_pwd = session.connection_properties.cortex_pwd
|
|
100
|
-
return _fluent_host_pid, _cortex_host, _inside_container, _cortex_pwd
|
|
101
|
-
|
|
102
|
-
fluent_host_pid, cortex_host, inside_container, cortex_pwd = f()
|
|
103
|
-
time.sleep(10)
|
|
104
|
-
if inside_container:
|
|
105
|
-
assert get_container(cortex_host)
|
|
106
|
-
subprocess.Popen(["docker", "stop", cortex_host]) # cortex_host = container_id
|
|
107
|
-
else:
|
|
108
|
-
from pathlib import Path
|
|
109
|
-
|
|
110
|
-
assert _pid_exists(fluent_host_pid)
|
|
111
|
-
if os.name == "nt":
|
|
112
|
-
cleanup_file_ext = "bat"
|
|
113
|
-
cmd_list = []
|
|
114
|
-
elif os.name == "posix":
|
|
115
|
-
cleanup_file_ext = "sh"
|
|
116
|
-
cmd_list = ["bash"]
|
|
117
|
-
else:
|
|
118
|
-
raise Exception("Unrecognized operating system.")
|
|
119
|
-
cleanup_file_name = (
|
|
120
|
-
f"cleanup-fluent-{cortex_host}-{fluent_host_pid}.{cleanup_file_ext}"
|
|
121
|
-
)
|
|
122
|
-
print(f"cleanup_file_name: {cleanup_file_name}")
|
|
123
|
-
cmd_list.append(Path(cortex_pwd, cleanup_file_name))
|
|
124
|
-
print(f"cmd_list: {cmd_list}")
|
|
125
|
-
subprocess.Popen(
|
|
126
|
-
cmd_list,
|
|
127
|
-
stdout=subprocess.DEVNULL,
|
|
128
|
-
stderr=subprocess.DEVNULL,
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
def test_does_not_exit_fluent_by_default_when_connected_to_running_fluent(
|
|
133
|
-
monkeypatch,
|
|
134
|
-
) -> None:
|
|
135
|
-
session1 = pyfluent.launch_fluent()
|
|
136
|
-
|
|
137
|
-
with pytest.raises(IpPortNotProvided):
|
|
138
|
-
session2 = pyfluent.connect_to_fluent(
|
|
139
|
-
ip=session1.connection_properties.ip,
|
|
140
|
-
password=session1.connection_properties.password,
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
session2 = pyfluent.connect_to_fluent(
|
|
144
|
-
ip=session1.connection_properties.ip,
|
|
145
|
-
port=session1.connection_properties.port,
|
|
146
|
-
password=session1.connection_properties.password,
|
|
147
|
-
)
|
|
148
|
-
assert session2.health_check.is_serving
|
|
149
|
-
session2.exit()
|
|
150
|
-
|
|
151
|
-
timeout_loop(
|
|
152
|
-
session1.health_check.is_serving,
|
|
153
|
-
5.0,
|
|
154
|
-
expected="truthy",
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
assert session1.health_check.is_serving
|
|
158
|
-
session1.exit()
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
def test_exit_fluent_when_connected_to_running_fluent(
|
|
162
|
-
monkeypatch,
|
|
163
|
-
) -> None: # import ansys.fluent.core as pyfluent
|
|
164
|
-
session1 = pyfluent.launch_fluent(cleanup_on_exit=False)
|
|
165
|
-
session2 = pyfluent.connect_to_fluent(
|
|
166
|
-
ip=session1.connection_properties.ip,
|
|
167
|
-
port=session1.connection_properties.port,
|
|
168
|
-
password=session1.connection_properties.password,
|
|
169
|
-
cleanup_on_exit=True,
|
|
170
|
-
)
|
|
171
|
-
session2.exit()
|
|
172
|
-
|
|
173
|
-
timeout_loop(
|
|
174
|
-
session1.health_check.is_serving,
|
|
175
|
-
5.0,
|
|
176
|
-
expected="falsy",
|
|
177
|
-
)
|
|
178
|
-
|
|
179
|
-
assert not session1.health_check.is_serving
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
def test_fluent_connection_properties(
|
|
183
|
-
new_solver_session,
|
|
184
|
-
) -> None:
|
|
185
|
-
connection_properties = new_solver_session.connection_properties
|
|
186
|
-
assert isinstance(connection_properties.ip, str)
|
|
187
|
-
assert isinstance(connection_properties.port, int)
|
|
188
|
-
assert isinstance(connection_properties.password, str)
|
|
189
|
-
assert isinstance(connection_properties.cortex_pwd, str)
|
|
190
|
-
assert isinstance(connection_properties.cortex_pid, int)
|
|
191
|
-
assert isinstance(connection_properties.cortex_host, str)
|
|
192
|
-
assert isinstance(connection_properties.inside_container, (bool, Container))
|
|
193
|
-
assert isinstance(connection_properties.fluent_host_pid, int)
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
def test_fluent_freeze_kill(
|
|
197
|
-
new_solver_session,
|
|
198
|
-
) -> None:
|
|
199
|
-
session = new_solver_session
|
|
200
|
-
_read_case(session=session, lightweight_setup=False)
|
|
201
|
-
|
|
202
|
-
def _freeze_fluent(s):
|
|
203
|
-
try:
|
|
204
|
-
s.tui.mesh.modify_zones.sep_face_zone_face("interior--fluid", "yes")
|
|
205
|
-
except RuntimeError as expected_tui_error_from_force_exit:
|
|
206
|
-
return expected_tui_error_from_force_exit
|
|
207
|
-
return
|
|
208
|
-
|
|
209
|
-
tmp_thread = threading.Thread(target=_freeze_fluent, args=(session,), daemon=True)
|
|
210
|
-
tmp_thread.start()
|
|
211
|
-
tmp_thread.join(5)
|
|
212
|
-
if tmp_thread.is_alive():
|
|
213
|
-
session.exit(timeout=1, timeout_force=True)
|
|
214
|
-
tmp_thread.join()
|
|
215
|
-
else:
|
|
216
|
-
raise Exception("Test should have temporarily frozen Fluent, but did not.")
|
|
217
|
-
|
|
218
|
-
assert session._fluent_connection.wait_process_finished(wait=5)
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
@pytest.mark.fluent_version(">=23.1")
|
|
222
|
-
def test_interrupt(static_mixer_case_session):
|
|
223
|
-
solver = static_mixer_case_session
|
|
224
|
-
solver.setup.general.solver.time = "unsteady-2nd-order"
|
|
225
|
-
solver.solution.initialization.standard_initialize()
|
|
226
|
-
asynchronous(solver.solution.run_calculation.dual_time_iterate)(
|
|
227
|
-
time_step_count=100, max_iter_per_step=20
|
|
228
|
-
)
|
|
229
|
-
time.sleep(5)
|
|
230
|
-
solver.solution.run_calculation.interrupt()
|
|
231
|
-
assert solver.scheme_eval.scheme_eval("(rpgetvar 'time-step)") < 100
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
def test_fluent_exit(monkeypatch: pytest.MonkeyPatch):
|
|
235
|
-
monkeypatch.delenv("PYFLUENT_LOGGING")
|
|
236
|
-
monkeypatch.delenv("PYFLUENT_WATCHDOG_DEBUG")
|
|
237
|
-
inside_container = os.getenv("PYFLUENT_LAUNCH_CONTAINER")
|
|
238
|
-
import ansys.fluent.core as pyfluent
|
|
239
|
-
|
|
240
|
-
solver = pyfluent.launch_fluent(start_watchdog=False)
|
|
241
|
-
cortex = (
|
|
242
|
-
solver.connection_properties.cortex_host
|
|
243
|
-
if inside_container
|
|
244
|
-
else solver.connection_properties.cortex_pid
|
|
245
|
-
)
|
|
246
|
-
solver.exit()
|
|
247
|
-
assert timeout_loop(
|
|
248
|
-
lambda: (inside_container and not get_container(cortex))
|
|
249
|
-
or (not inside_container and not _pid_exists(cortex)),
|
|
250
|
-
timeout=60,
|
|
251
|
-
idle_period=1,
|
|
252
|
-
)
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
def test_fluent_exit_wait():
|
|
256
|
-
session1 = pyfluent.launch_fluent()
|
|
257
|
-
session1.exit()
|
|
258
|
-
assert not session1._fluent_connection.wait_process_finished(wait=0)
|
|
259
|
-
|
|
260
|
-
session2 = pyfluent.launch_fluent()
|
|
261
|
-
session2.exit(wait=60)
|
|
262
|
-
assert session2._fluent_connection.wait_process_finished(wait=0)
|
|
263
|
-
|
|
264
|
-
session3 = pyfluent.launch_fluent()
|
|
265
|
-
session3.exit(wait=True)
|
|
266
|
-
assert session3._fluent_connection.wait_process_finished(wait=0)
|
|
267
|
-
|
|
268
|
-
with pytest.raises(WaitTypeError):
|
|
269
|
-
session4 = pyfluent.launch_fluent()
|
|
270
|
-
session4.exit(wait="wait")
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
from ansys.fluent.core.utils.fluent_version import AnsysVersionNotFound, FluentVersion
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def test_examples():
|
|
7
|
-
assert FluentVersion("23.2.0") == FluentVersion.v232
|
|
8
|
-
assert FluentVersion.v232.number == 232
|
|
9
|
-
assert FluentVersion.v232.awp_var == "AWP_ROOT232"
|
|
10
|
-
assert FluentVersion.v232.name == "v232"
|
|
11
|
-
assert FluentVersion.v232.value == "23.2.0"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def test_version_found():
|
|
15
|
-
assert FluentVersion("23.2") == FluentVersion.v232
|
|
16
|
-
assert FluentVersion(23.2) == FluentVersion.v232
|
|
17
|
-
assert FluentVersion(232) == FluentVersion.v232
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def test_version_not_found():
|
|
21
|
-
with pytest.raises(AnsysVersionNotFound):
|
|
22
|
-
FluentVersion("25.3.0")
|
|
23
|
-
|
|
24
|
-
with pytest.raises(AnsysVersionNotFound):
|
|
25
|
-
FluentVersion(22)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def test_get_latest_installed(helpers):
|
|
29
|
-
helpers.mock_awp_vars()
|
|
30
|
-
assert FluentVersion.get_latest_installed() == FluentVersion.current_release()
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def test_gt():
|
|
34
|
-
assert FluentVersion.v232 > FluentVersion.v231
|
|
35
|
-
assert FluentVersion.v232 > FluentVersion.v222
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def test_ge():
|
|
39
|
-
assert FluentVersion.v232 >= FluentVersion.v232
|
|
40
|
-
assert FluentVersion.v232 >= FluentVersion.v231
|
|
41
|
-
assert FluentVersion.v232 >= FluentVersion.v222
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def test_lt():
|
|
45
|
-
assert FluentVersion.v232 < FluentVersion.v242
|
|
46
|
-
assert FluentVersion.v232 < FluentVersion.v241
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def test_le():
|
|
50
|
-
assert FluentVersion.v232 <= FluentVersion.v232
|
|
51
|
-
assert FluentVersion.v232 <= FluentVersion.v242
|
|
52
|
-
assert FluentVersion.v232 <= FluentVersion.v241
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
def test_ne():
|
|
56
|
-
assert FluentVersion.v232 != FluentVersion.v242
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def test_eq():
|
|
60
|
-
assert FluentVersion.v232 == FluentVersion.v232
|
|
61
|
-
assert FluentVersion.v241 == FluentVersion.v241
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
def test_str_output():
|
|
65
|
-
assert str(FluentVersion.v232) == "Fluent version 2023 R2"
|
|
66
|
-
assert str(FluentVersion.v251) == "Fluent version 2025 R1"
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def test_dev_fluent_any():
|
|
5
|
-
pass
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@pytest.mark.fluent_version("latest")
|
|
9
|
-
def test_dev_fluent_latest():
|
|
10
|
-
pass
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
@pytest.mark.fluent_version(">=24.1")
|
|
14
|
-
def test_dev_fluent_ge_241():
|
|
15
|
-
pass
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@pytest.mark.fluent_version(">=23.2")
|
|
19
|
-
def test_dev_fluent_ge_232():
|
|
20
|
-
pass
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@pytest.mark.fluent_version(">=23.1")
|
|
24
|
-
def test_dev_fluent_ge_231():
|
|
25
|
-
pass
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
@pytest.mark.fluent_version(">=22.2")
|
|
29
|
-
def test_dev_fluent_ge_222():
|
|
30
|
-
pass
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
@pytest.mark.nightly
|
|
34
|
-
def test_nightly_fluent_any():
|
|
35
|
-
pass
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
@pytest.mark.nightly
|
|
39
|
-
@pytest.mark.fluent_version("latest")
|
|
40
|
-
def test_nightly_fluent_latest():
|
|
41
|
-
pass
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
@pytest.mark.nightly
|
|
45
|
-
@pytest.mark.fluent_version(">=24.1")
|
|
46
|
-
def test_nightly_fluent_ge_241():
|
|
47
|
-
pass
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
@pytest.mark.nightly
|
|
51
|
-
@pytest.mark.fluent_version(">=23.2")
|
|
52
|
-
def test_nightly_fluent_ge_232():
|
|
53
|
-
pass
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
@pytest.mark.nightly
|
|
57
|
-
@pytest.mark.fluent_version(">=23.1")
|
|
58
|
-
def test_nightly_fluent_ge_231():
|
|
59
|
-
pass
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
@pytest.mark.nightly
|
|
63
|
-
@pytest.mark.fluent_version(">=22.2")
|
|
64
|
-
def test_nightly_fluent_ge_222():
|
|
65
|
-
pass
|