Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ jobs:
env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
PYFLUENT_FLUENT_PORT: 63084
PYFLUENT_START_INSTANCE: 0

- name: Upload HTML Documentation
uses: actions/upload-artifact@v2
Expand Down
8 changes: 6 additions & 2 deletions ansys/fluent/core/launcher/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def launch_fluent(
start_timeout: int = 100,
additional_arguments: str = "",
env: Dict[str, Any] = None,
start_instance: bool = True,
start_instance: bool = None,
ip: str = None,
port: int = None,
cleanup_on_exit: bool = True,
Expand Down Expand Up @@ -118,7 +118,9 @@ def launch_fluent(
start_instance : bool, optional
When False, connect to an existing Fluent instance at ``ip``
and ``port``, which default to ``'127.0.0.1'`` at 63084.
Otherwise, launch a local instance of Fluent. Default is True.
Otherwise, launch a local instance of Fluent. Default is True
which can be overwritten by the environment variable
``PYFLUENT_START_INSTANCE=<0 or 1>``.

ip : str, optional
IP address to connect to existing Fluent instance. Used only
Expand All @@ -142,6 +144,8 @@ def launch_fluent(
Fluent session.
"""
argvals = locals()
if start_instance is None:
start_instance = bool(int(os.getenv("PYFLUENT_START_INSTANCE", "1")))
if start_instance:
exe_path = _get_fluent_exe_path()
launch_string = exe_path
Expand Down
8 changes: 6 additions & 2 deletions examples/00-fluent/mixing_elbow_settings_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@

###############################################################################

# First, connect with a Fluent server
# First, download the geometry file and start Fluent as a service with
# Meshing Mode, Double Precision, Number of Processors 4

import ansys.fluent.core as pyfluent
from ansys.fluent.core import examples
Expand All @@ -48,7 +49,10 @@
import_filename = examples.download_file(
"mixing_elbow.pmdb", "pyfluent/mixing_elbow"
)
s = pyfluent.launch_fluent(start_instance=False)

s = pyfluent.launch_fluent(
meshing_mode=True, precision="double", processor_count="4"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will now look like standalone run, although it will connect to a docker container in github CI.

)

###############################################################################

Expand Down
8 changes: 6 additions & 2 deletions examples/00-fluent/mixing_elbow_tui_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@

###############################################################################

# First, connect with a Fluent server
# First, download the geometry file and start Fluent as a service with
# Meshing Mode, Double Precision, Number of Processors 4

import ansys.fluent.core as pyfluent
from ansys.fluent.core import examples
Expand All @@ -47,7 +48,10 @@
import_filename = examples.download_file(
"mixing_elbow.pmdb", "pyfluent/mixing_elbow"
)
s = pyfluent.launch_fluent(start_instance=False)

s = pyfluent.launch_fluent(
meshing_mode=True, precision="double", processor_count="4"
)

###############################################################################

Expand Down