Skip to content

Commit c812ed4

Browse files
raph-lucmkundu1ochernukprmukherjhpohekar
authored
Bump version 0.18.1 (#2175)
* Fix vale warnings (#2139) * fix tensor type for displacement variable (#2145) * Fix set_state implementation for command argument instance. (#2147) * Update flobject.py (#2148) * SVAR Doc (#1635) * Test to catch Watchdog launch errors, and improved Watchdog behavior on Windows (#2144) * Cavitation Model Example And Example Warning Fix (#2102) * Add type annotations for some modules under services (#2108) * More robust Windows launch command for Watchdog (#2167) * Making h5py an optional dependency, not installed by default (#2171) * Expose settings root like in pyconsole. (#2149) * Remove timeout loop in FluentConnection (#2126) * Fix SVAR doc (#2172) --------- Co-authored-by: Mainak Kundu <[email protected]> Co-authored-by: Oleg Chernukhin <[email protected]> Co-authored-by: Prithwish Mukherjee <[email protected]> Co-authored-by: Harshal Pohekar <[email protected]> Co-authored-by: Aseem Jain <[email protected]> Co-authored-by: Prithwish Mukherjee <[email protected]> Co-authored-by: Adam Boutin <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 4c86d0a commit c812ed4

39 files changed

+1082
-438
lines changed

.github/styles/Vocab/ANSYS/accept.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
ANSYS
22
Ansys
33
ansys
4+
API
45
batch_ops
56
CaseFile
67
DataFile
8+
CAD
79
CommandArguments
810
error_handler
911
events
@@ -63,10 +65,15 @@ Streaming
6365
Session
6466
Slurm
6567
transcript
68+
TUI
6669
UDFs
6770
Univa
6871
venv
6972
mass_flow
7073
mass_average
7174
mass_integrated_average
72-
caf
75+
caf
76+
svar_info
77+
svar_data
78+
SVAR
79+
SVARs

.vale.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ BasedOnStyles = Vale, Google
3030
# Removing Google-specific rule - Not applicable under some circumstances
3131
Google.WordList = NO
3232
Google.Colons = NO
33-
Google.OxfordComma = NO
33+
Google.OxfordComma = NO
34+
Google.Headings = NO

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ include src/ansys/fluent/core/launcher/fluent_launcher_options.json
22
include src/ansys/fluent/core/docs/README.rst
33
include src/ansys/fluent/core/logging_config.yaml
44
include src/ansys/fluent/core/quantity/cfg.yaml
5+
include src/ansys/fluent/core/launcher/watchdog_exec
56
recursive-include src/ansys/fluent/core *pyi
67
recursive-include src/ansys/fluent/core/data api_tree_*.pickle
39.3 KB
Loading
43.5 KB
Loading
40.6 KB
Loading
33 KB
Loading

doc/source/api/solver/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ and field data (surface, scalar, and vector).
2828
events
2929
monitors
3030
reduction
31+
svar

doc/source/api/solver/svar.rst

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
.. _ref_svar_data:
2+
3+
SVAR data
4+
=========
5+
6+
An SVAR is an array variable that holds the data for a particular
7+
solved field (such as pressure or velocity). You can use svar_info
8+
and svar_data objects to access Fluent SVAR info and data respectively.
9+
10+
Accessing SVAR objects
11+
----------------------
12+
13+
Launch the fluent solver, and make SVAR objects available
14+
(for example, by reading case and data files):
15+
16+
.. code-block:: python
17+
18+
>>> import ansys.fluent.core as pyfluent
19+
>>> from ansys.fluent.core import examples
20+
>>> import_filename = examples.download_file("mixing_elbow.msh.h5", "pyfluent/mixing_elbow")
21+
>>> solver = pyfluent.launch_fluent(mode="solver")
22+
>>> solver.file.read(file_type="case", file_name=import_filename)
23+
24+
25+
The svar_info and svar_data objects are attributes of the solver object:
26+
27+
.. code-block:: python
28+
29+
>>> svar_info = solver.svar_info
30+
>>> svar_data = solver.svar_data
31+
32+
33+
SVAR info
34+
---------
35+
SVAR metadata information can be accessed via the following svar_info methods:
36+
37+
- ``get_zones_info`` for zone information.
38+
- ``get_svars_info`` for SVAR information.
39+
40+
Get zone information
41+
~~~~~~~~~~~~~~~~~~~~
42+
You can access zone information by calling the ``get_zones_info`` method.
43+
44+
.. code-block:: python
45+
46+
>>> zones_info = svar_info.get_zones_info()
47+
>>> zones_info.domains
48+
['mixture']
49+
>>>
50+
>>> zones_info.zones
51+
['fluid', 'wall', 'symmetry', 'pressure-outlet-7', 'velocity-inlet-6', 'velocity-inlet-5', 'default-interior']
52+
>>>
53+
>>> zone_info = zones_info['wall']
54+
>>>
55+
>>> zone_info
56+
name:wall count: 3630 zone_id:3 zone_type:wall thread_type:Face
57+
>>>
58+
>>> zone_info.name
59+
'wall'
60+
>>>
61+
>>> zone_info.count
62+
3630
63+
>>>
64+
>>> zone_info.zone_id
65+
3
66+
>>>
67+
>>> zone_info.zone_type
68+
'wall'
69+
70+
Get SVAR information
71+
~~~~~~~~~~~~~~~~~~~~
72+
You can request SVARs information for a given ``domain_name`` and list of ``zone_names``
73+
by calling the ``get_svars_info`` method.
74+
75+
.. code-block:: python
76+
77+
>>> svars_info_wall_fluid = svar_info.get_svars_info(zone_names=['wall' , "fluid"], domain_name="mixture")
78+
>>>
79+
>>> svars_info_wall_fluid.svars
80+
['SV_CENTROID', 'SV_D', 'SV_H', 'SV_K', 'SV_P', 'SV_T', 'SV_U', 'SV_V', 'SV_W']
81+
>>>
82+
>>> svar_info_centroid = svars_info_wall_fluid['SV_CENTROID']
83+
>>>
84+
>>> svar_info_centroid
85+
name:SV_CENTROID dimension:3 field_type:<class 'numpy.float64'>
86+
>>>
87+
>>>svar_info_centroid.name
88+
'SV_CENTROID'
89+
>>>
90+
>>>svar_info_centroid.dimension
91+
>>>3
92+
>>>
93+
>>>svar_info_centroid.field_type
94+
<class 'numpy.float64'>
95+
96+
SVAR data
97+
---------
98+
SVAR data can be extracted and modified via the following svar_data object methods:
99+
100+
- ``get_svar_data`` to get SVAR data.
101+
- ``set_svar_data`` to set SVAR data.
102+
103+
104+
Get SVAR data
105+
~~~~~~~~~~~~~
106+
You can request SVAR data for a given ``domain_name`` and multiple ``zone_names`` by calling
107+
the ``get_svar_data`` method and passing the particular ``svar_name``.
108+
109+
.. code-block:: python
110+
111+
>>> sv_t_wall_fluid= svar_data.get_svar_data(svar_name="SV_T", zone_names=["fluid", "wall"], domain_name="mixture")
112+
>>>
113+
>>> sv_t_wall_fluid.domain
114+
'mixture'
115+
>>>
116+
>>> sv_t_wall_fluid.zones
117+
['fluid', 'wall']
118+
>>>
119+
>>> fluid_temp = sv_t_wall_fluid['fluid']
120+
>>>
121+
>>> fluid_temp.size
122+
13852
123+
>>>
124+
>>> fluid_temp.dtype
125+
'float64'
126+
>>>
127+
>>> fluid_temp
128+
array([600., 600., 600., ..., 600., 600., 600.])
129+
130+
Set SVAR data
131+
~~~~~~~~~~~~~
132+
You can set SVAR data for a given ``domain_name`` by calling the ``set_svar_data``
133+
method and passing required ``svar_name`` and dictionary of ``zone_name``
134+
to numpy array of ``svar_data``
135+
136+
Additionally svar_data object also supports ``get_array`` method. This method can be used to
137+
generate ``numpy zeros array`` for a given ``domain_name``, ``zone_name`` and
138+
``svar_name``. This array can be populated and passed to ``set_svar_data``.
139+
140+
.. code-block:: python
141+
142+
>>> wall_temp_array = svar_data.get_array("SV_T", "wall", "mixture")
143+
>>> fluid_temp_array = svar_data.get_array("SV_T", "fluid", "mixture")
144+
>>> wall_temp_array[:] = 500
145+
>>> fluid_temp_array[:] = 600
146+
>>> zone_names_to_svar_data = {'wall':wall_temp_array, 'fluid':fluid_temp_array}
147+
>>> svar_data.set_svar_data(svar_name="SV_T", zone_names_to_svar_data=zone_names_to_svar_data, domain_name="mixture")
148+
149+
.. currentmodule:: ansys.fluent.core.services
150+
151+
.. autosummary::
152+
:toctree: _autosummary
153+
:template: flobject-class-template.rst
154+
:recursive:
155+
156+
svar.SVARInfo
157+
svar.SVARData
158+

examples/00-fluent/external_compressible_flow.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@
4949
from ansys.fluent.core import examples
5050

5151
wing_spaceclaim_file, wing_intermediary_file = [
52-
examples.download_file(
53-
CAD_file, "pyfluent/external_compressible", save_path=pyfluent.EXAMPLES_PATH
54-
)
52+
examples.download_file(CAD_file, "pyfluent/external_compressible")
5553
for CAD_file in ["wing.scdoc", "wing.pmdb"]
5654
]
5755

@@ -65,7 +63,6 @@
6563
precision="double",
6664
processor_count=4,
6765
mode="meshing",
68-
cwd=pyfluent.EXAMPLES_PATH,
6966
)
7067

7168
###############################################################################
@@ -327,7 +324,7 @@
327324
###############################################################################
328325
# Save case file
329326
# ~~~~~~~~~~~~~~
330-
# Solve the case file (``external_compressible1.cas.h5``).
327+
# Save the case file ``external_compressible1.cas.h5``.
331328

332329
solver.file.write(file_name="external_compressible.cas.h5", file_type="case")
333330

0 commit comments

Comments
 (0)