Tagged: ansys-apdl, apdl-command, APDL-thermal, matlab, mechanical-apdl
-
-
March 21, 2022 at 10:48 am
IsaccoRafanelli
SubscriberHi everybody,
i'm launching a Steady State Thermal analysis with an Ansys Mechanical APDL macro code from Matlab in order to automatize a decoupled CHT caculus, but i'm facing with some issues. The matlab string used to launch the simulation is the following:
"!"C:Program FilesANSYS directoryANSYS192.exe" -b -i input.mac -o output.txt"
where the file "input.mac" has been created in ANSYS Mechanical with the command "write input file" and contains either all the informations about geometry, mesh, boundary conditions, and the command "solve" in /solu environment, or the manually written macro code for the results export (written in /post1 environment after the "solve" command).
The main issue is that commands written after "solve" are not considered, no matter what i write (i tried to write some random digits but it doesnt give any errors/warnings) included the macro code for the results export.T he output file doesn't show any errors and at the end "solution converged after XX iterations" is written.
For a further test i tried to load the macro code on Ansys Mechanical APDL with the graphical interface. After the loading, solution data are not available and a manually written "/solu solve" is needed.
I report the /solu and the /post1 environments of "input.mac" here:
/com,****************************************************************************
/com,************************* SOLUTION ********************************
/com,****************************************************************************
/solu
antype,0 ! static analysis
!eqsl,sparse ! using sparse solver which is default so no eqsl command needed
cntr,print,1 ! print out contact info and also make no initial contact an error
rescontrol,,none ! Do not keep any restart files
dmpoption,emat,no ! Don't combine emat file for DANSYS
dmpoption,esav,no ! Don't combine esav file for DANSYS
/com,****************************************************
/com,******************* SOLVE FOR LS 1 OF 1 ****************
esel,s,type,,18
nsle
sf,all,hflux,5000
!OTHER BOUNDARY CONDITIONS ARE NOT REPORTED
nsel,all
esel,all
autots,on
nsub,1,10,1
time,1.
outres,erase
outres,all,none
outres,nsol,all
outres,rsol,all
outres,eangl,all
outres,etmp,all
outres,veng,all
outres,fflux,all
outres,cont,all
/nopr
esel,s,type,,22
esel,a,type,,23,49
cm,_elmisc,elem
esel,all
/gopr
outres,misc,all,_elmisc
cnvtol,heat,,.001,,1.e-006 ! Program Controlled. Set MINREF equivalent of 1e-6 Watts
! *********** WB SOLVE COMMAND ***********
! check interactive state
*get,ANSINTER_,active,,int
*if,ANSINTER_,ne,0,then
/eof
*endif
solve
!PROBLEM: COMMANDS WRITTEN BELOW ARE SKIPPED
/com *************** Write FE CONNECTORS *********
CEWRITE,file,ce,,INTE
/com,****************************************************
/com,*************** FINISHED SOLVE FOR LS 1 *************
*get,_wallasol,active,,time,wall
/post1
/INPUT,'postpr','dat','C:Users afanelliDocumentsITER1A',, 0 !MACRO FOR POSTPROCESS
xmlo,ENCODING,ISO-8859-1
xmlo,parm
/xml,parm,xml
fini
/gopr
*get,_walldone,active,,time,wall
_preptime=(_wallbsol-_wallstrt)*3600
_solvtime=(_wallasol-_wallbsol)*3600
_posttime=(_walldone-_wallasol)*3600
_totaltim=(_walldone-_wallstrt)*3600
*get,_dlbratio,active,0,solu,dlbr
/com,--- Number of total nodes = %_numnode%
/com,--- Number of total elements = %_numelem%
/com,--- Element load balance ratio = %_dlbratio%
/wb,file,end ! done with WB generated input
I think there is a problem with the solution command but i'm not able to figure out.
Thank you so much
March 22, 2022 at 12:12 pmgiuliogenerini
SubscriberHi everyone! I've the same problem: does anyone have the solution?
Thanks in advance!
March 23, 2022 at 4:47 pmAshish Khemka
Ansys Employee
Please see if the following link helps:
Run Ansys from Matlab | ths1104 geek├® (wordpress.com)
Regards Ashish Khemka
March 23, 2022 at 5:13 pmChandra Sekaran
Ansys EmployeeYou mention that the commands right after SOLVE are ignored. Does the output show that the SOLVE completed successfully? It almost sounds like the solve stopped without completion and nothing else is being executed. Do you have the postpr.dat in the location 'C:\Users\rafanelli\Documents\ITER1A\ ?
Viewing 3 reply threads- You must be logged in to reply to this topic.
Ansys Innovation SpaceBoost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.
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.
Ansys Blog
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.
Trending discussions- Saving & sharing of Working project files in .wbpz format
- Understanding Force Convergence Solution Output
- An Unknown error occurred during solution. Check the Solver Output…..
- Solver Pivot Warning in Beam Element Model
- Colors and Mesh Display
- whether have the difference between using contact and target bodies
- What is the difference between bonded contact region and fixed joint
- How to calculate the residual stress on a coating by Vickers indentation?
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- User manual
Top Contributors-
2726
-
2146
-
1357
-
1150
-
462
Top Rated Tags© 2023 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-