Spaces:
Runtime error
Runtime error
Create simulation.py
Browse files- modules/simulation.py +9 -0
modules/simulation.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from ansys.mapdl.core import launch_mapdl
|
| 2 |
+
|
| 3 |
+
def run_simulation(script_path):
|
| 4 |
+
try:
|
| 5 |
+
mapdl = launch_mapdl()
|
| 6 |
+
mapdl.input(script_path)
|
| 7 |
+
return "Simulation completed successfully. Results are stored in ANSYS output directory."
|
| 8 |
+
except Exception as e:
|
| 9 |
+
return f"Error during simulation: {str(e)}"
|