30.3.2. Workflow

A typical workflow for using the external server follows:

  1. Start the Python server (use either method):

    1. From the command line (in the running directory): \Path_to_Python\python.exe AqwaSocketUserForceExample.py

    2. By drag-and-drop: Drag and drop the AqwaSocketUserForceExample.py onto the StartAqwaPythonUserForceServer.bat file, both of which should be present in the running directory.

    The server waits for connections and generates a file in the running directory: AQWA_SocketUserForceServerDetails.cfg.

  2. Start Aqwa to run the designated .DAT file in the running directory, either from the command line or by drag and dropping the file onto the Aqwa executable. The .DAT must have the SUFC option turned on.

  3. On startup, Aqwa takes the following steps:

    1. Aqwa looks for the AQWA_SocketUserForceServerDetails.cfg file in the current working directory (where the data file is stored).

      If the server script and input file are located in the same directory, the program can discover the hostname and port in this way.

    2. If the previous step fails, Aqwa examines the contents of the environment variable ANSYS_AQWA_SOCKET_USERFORCE_SERVERINFOFILE. This can manually be set as the path to the configuration file, including the file name itself.

    3. If the previous two steps fail, Aqwa examines the contents of the environment variable ANSYS_AQWA_SOCKET_USERFORCE_SERVER. You can manually set the value of this environment variable as hostname:portnumber using the contents of AQWA_SocketUserForceServerDetails.cfg.

    4. If all of the previous steps fail, Aqwa stops and generates the log file AQWA_SocketUserForceLog.txt.

  4. Aqwa then tries to connect to the server using the information discovered in step 3. Once the connection is established, data exchange begins.