Skip to content

Commit 1525f58

Browse files
committed
Add download_cfx_mixing_elbow
1 parent 47291c3 commit 1525f58

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

src/ansys/dpf/core/examples/downloads.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,3 +1495,51 @@ def download_cfx_heating_coil(
14951495
return_local_path,
14961496
)
14971497
return {"cas": file, "dat": file}
1498+
1499+
1500+
def download_cfx_mixing_elbow(
1501+
should_upload: bool = True, server=None, return_local_path=False
1502+
) -> dict:
1503+
"""Download the flprj, cas and dat files of a CFX analysis of a mixing elbow
1504+
and return the download paths into a dictionary extension->path.
1505+
If the server is remote (or doesn't share memory), the file is uploaded or made available
1506+
on the server side.
1507+
1508+
Examples files are downloaded to a persistent cache to avoid
1509+
re-downloading the same file twice.
1510+
1511+
Parameters
1512+
----------
1513+
should_upload : bool, optional (default True)
1514+
Whether the file should be uploaded server side when the server is remote.
1515+
server : server.DPFServer, optional
1516+
Server with channel connected to the remote or local instance. When
1517+
``None``, attempts to use the global server.
1518+
return_local_path: bool, optional
1519+
If ``True``, the local path is returned as is, without uploading, nor searching
1520+
for mounted volumes.
1521+
1522+
Returns
1523+
-------
1524+
dict[str:str]
1525+
Path to the example files.
1526+
1527+
Examples
1528+
--------
1529+
Download an example result file and return the path of the file
1530+
1531+
>>> from ansys.dpf.core import examples
1532+
>>> paths = examples.download_cfx_mixing_elbow()
1533+
>>> paths
1534+
{'cas': 'C:\\Users\\user\\AppData\\Local\\ansys-dpf-core\\ansys-dpf-core\\examples\\cfx-mixing_elbow\\InjectMixer.res',
1535+
'dat': 'C:\\Users\\user\\AppData\\Local\\ansys-dpf-core\\ansys-dpf-core\\examples\\cfx-mixing_elbow\\InjectMixer.res'} # noqa: E501
1536+
1537+
"""
1538+
file = _download_file(
1539+
"result_files/cfx-mixing_elbow",
1540+
"InjectMixer.res",
1541+
should_upload,
1542+
server,
1543+
return_local_path,
1544+
)
1545+
return {"cas": file, "dat": file}

0 commit comments

Comments
 (0)