Skip to content

Commit

Permalink
minor fix in the script
Browse files Browse the repository at this point in the history
  • Loading branch information
vnamdeo committed Dec 16, 2024
1 parent 9b6fa99 commit 0c120fb
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions cheat_sheets/pyworkbench_cheat_sheet/pyworkbench_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,13 @@

sys_name = wb.run_script_string(
r"""import json
wb_script_result=json.dumps(GetTemplate(TemplateName="Static Structural (ANSYS)").CreateSystem().Name)
wb_script_result =
json.dumps(GetTemplate(TemplateName="Static Structural (ANSYS)").CreateSystem().Name)
"""
)
server_port = wb.start_mechanical_server(system_name=sys_name)
server_port = wb.start_mechanical_server(
system_name=sys_name
)
mechanical = connect_to_mechanical(
ip="localhost", port=server_port
)
Expand All @@ -86,10 +89,13 @@

sys_name = wb.run_script_string(
r"""import json
wb_script_result=json.dumps(GetTemplate(TemplateName="FLUENT").CreateSystem().Name)
wb_script_result =
json.dumps(GetTemplate(TemplateName="FLUENT").CreateSystem().Name)
"""
)
server_info_file = wb.start_fluent_server(system_name=sys_name)
server_info_file = wb.start_fluent_server(
system_name=sys_name
)
fluent = pyfluent.connect_to_fluent(
server_info_file_name=server_info_file
)
Expand All @@ -98,9 +104,14 @@

sys_name = wb.run_script_string(
r"""import json
wb_script_result=json.dumps(GetTemplate(TemplateName="SherlockPre").CreateSystem().Name)
wb_script_result =
json.dumps(GetTemplate(TemplateName="SherlockPre").CreateSystem().Name)
"""
)
server_port = wb.start_sherlock_server(system_name=sys_name)
sherlock = pysherlock.connect_grpc_channel(port=server_port)
server_port = wb.start_sherlock_server(
system_name=sys_name
)
sherlock = pysherlock.connect_grpc_channel(
port=server_port
)
# BREAK BLOCK

0 comments on commit 0c120fb

Please sign in to comment.