June 26, 2018 at 1:57 pmaleksandar.milakovicSubscriber
I have problems outputting the results from ANSYS 18.2 when run from MATLAB R2018a in batch mode on a 64-bit Windows 7 machine. I am using the following procedure:
I have created an APDL file for ANSYS called geom_sol_out.txt which contains geometry commands, boundary conditions, loads, solve commands and output command to write results into a text file. I run it from MATLAB by running batch file run_ansys.bat which contains:
"C:Program FilesANSYS Incv182ansysbinwinx64ANSYS182" -b -i ansysinputreader.txt -o out.dat
with ansysinputreader.txt containing /INPUT,'geom_sol_out','txt','H:test',, 0
This works nicely until the SOLVE command in geom_sol_out.txt is reached. After the solution is done, ANSYS simply ignores all the commands following the SOLVE command, so I cannot output the nodal results. I am using /OUTPUT command to output the results into text file. (note: /OUTPUT command works fine for e.g. nodal coordinates when it is called before the SOLVE command, but not when it it is called afterwards)
Can anyone help me with this?
Thank you in advance.
June 28, 2018 at 6:13 amBhargava SistaAnsys Employee
This may sound trivial but are you issuing /POST1 or /POST26 after the SOLVE command to enter the post-processing module? Perhaps it may help if you can share the .out file for any warnings or errors.
June 28, 2018 at 10:21 amaleksandar.milakovicSubscriber
Thank you for your comment. In the meantime, I managed to solve my problem. The issue was in the lack of memory and that is the reason why the file stopped execution at some point. It was solved by adding SET KMP_STACKSIZE=2048k to the batch file.
September 12, 2018 at 9:27 pmAlkallaSubscriber
I have the same problem, the file in working fine with the interactive mode, but when using the batch mode it stops before /post1 command.
Would you please let me know how you use the command you mentioned above (SET KMP_STACKSIZE=2048k).
September 13, 2018 at 4:01 pmaleksandar.milakovicSubscriber
First I create a batch file run_ansys.bat containing: (make sure to change the path calling ANSYS applicable to your system. Also, you might need more than 2048k)
"C:Program FilesANSYS Incv181ansysbinwinx64ANSYS181" -b -i ansysinputreader.txt -o out.dat
The ansysinputreader.txt contains the following:
/INPUT,'A_02','txt','C:UsersA.-S. MilakovicDropboxWorkTUHHMoritzpaper_1T_joint_Astress_grad_calcs',, 0
which is simply a path to an APDL file containing geometry, mesh, loads, and solve commands for ANSYS including the /OUTPUT command which outputs the desired results from ANSYS into a .txt file in the current directory. Here is an example of an /OUTPUT command in ANSYS APDL which outputs nodal stresses into stress_nodes.txt:
Finally, I simply call !run_ansys.bat from MATLAB and get the desired output files which I can then read back into MATLAB and analyse.
Hope this helps.
October 3, 2018 at 7:04 pmMeruSubscriber
Hi, I have started a project that require similar things ( like running Ansys in Batch mode from matlab) I do not know how to write an APDL file and How to write a batch file that can open Ansys . Can you please guide me in a proper direction of source that I can refer and learn how to do it. It would be really helpfull. Thank you.
October 3, 2018 at 7:20 pmpeteroznewmanSubscriber
Maybe you can do everything in ANSYS without matlab. What are you doing in matlab that you can't do in ANSYS?
Or, if you don't know ANSYS well enough to answer that question, perhaps you could tell us what you are trying to do.
November 7, 2019 at 6:31 pmkintoresenpaiSubscriber
You are a genius! Thank you so much
October 18, 2020 at 2:02 amalverlandoricardoSubscriberI was having the same problem. I uninstalled and installed several versions of matlab/ansys, however, it only worked when I changed the command in matlab:n !C: \ Program Files \ ANSYS Inc \ v192\ ansys \ bin \ winx64 \ ANSYS192 -b -i FEAin.txt -o FEAout.dat nby:nsystem ('SET KMP_STACKSIZE = 10240k & C: \ Program Files \ ANSYS Inc \ v192 \ ansys \ bin \ winx64 \ ANSYS192 -b -i FEAin.txt -o FEAout.dat') nThanks for the help, you saved my research!!!n
- You must be logged in to reply to this topic.
Simulation World 2022
Check out more than 70 different sessions now available on demand. Get inspired as you hear from visionary companies, leading researchers and educators from around the globe on a variety of topics from life-saving improvements in healthcare, to bold new realities of space travel. Take a leap of certainty and check out a session today here.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- How to calculate the residual stress on a coating by Vickers indentation?
- An Unknown error occurred during solution. Check the Solver Output…..
- Saving & sharing of Working project files in .wbpz format
- Solver Pivot Warning in Beam Element Model
- Understanding Force Convergence Solution Output
- whether have the difference between using contact and target bodies
- Colors and Mesh Display
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- Massive amount of memory (RAM) required for solve
- What is the difference between bonded contact region and fixed joint
© 2022 Copyright ANSYS, Inc. All rights reserved.