TAGGED: ansys-apdl, ansys-transient-thermal, data
-
-
August 13, 2024 at 4:19 amzzhang868Subscriber
Hi all, I’m wondering if we can use APDL commands under "Analysis Settings" to automate the process of inputting data for each time step, instead of doing it manually. Would this be more efficient?
This is my current script:! Define the temperature values for each cycle (2400 seconds cycle)*DIM,TEMP_ARRAY,ARRAY,5,1TEMP_ARRAY(1) = 0 ! Temperature at 0 secondsTEMP_ARRAY(2) = 0 ! Temperature at 600 secondsTEMP_ARRAY(3) = 125 ! Temperature at 1200 secondsTEMP_ARRAY(4) = 125 ! Temperature at 1800 secondsTEMP_ARRAY(5) = 0 ! Temperature at 2400 seconds! Loop over each of the 400 steps (100 cycles total)*DO,I,1,400! Calculate the index in the temperature array (cycles every 5 steps)INDEX = MOD(I-1,5) + 1! Apply the temperature at the current stepALLSEL,ALLSF,ALL,CONV,TEMP_ARRAY(INDEX)*ENDDOSince I have input some data via GUI, I am wondering whether APDL commands will overread what I have input manually. Any suggestions would be appreciated! Thanks!
-
August 13, 2024 at 11:06 pmmjmiddleAnsys Employee
You can aqply a load by APDL if you want. You are applying it by independent SF command so it won't override any load Mechanical defines unless a native load in Mechanical also creates this SF comand on the same nodes.
However, your APDL code is not right because it just keeps applying the same 5 index values over again without a time index or TIME command or issuing SOLVE command each time. You can use a table that contains the time and magnitude data in the SF command. See the help for the SF command:
https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v242/en/ans_cmd/Hlp_C_SF.htmlExample: The following table has 4 rows, with times 0 sec, 0.3 sec, 0.7 sec, 1 sec
*DIM,_convec_data,TABLE,4,1,1,TIME, , , 0
! Time values
*TAXIS,_convec_data(1),1,0.,0.3,0.7,1.
! Load values
_convec_data(1,1,1) = 10.2
_convec_data(2,1,1) = 11.4
_convec_data(3,1,1) = 12.6
_convec_data(4,1,1) = 14.0
sf,all,conv,%_convec_data%You should also apply another table for the value 2 as the bulk fluid temperatures:
SF, Nlist, Lab, VALUE, VALUE2, – ,MESHFLAG -
August 13, 2024 at 11:15 pmmjmiddleAnsys Employee
In a native Mechanical convection load, you could also paste the data from Excel by selecting rows, then right clicking to choose "Paste Cell":
You could also use python scripting in Mechanical to create the convection load and populate the table data. Table data uses a "field" variable. See all the sections under:
https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v242/en/act_script/mech_apis_BoundaryConditions.html
-
August 14, 2024 at 3:01 amzzhang868Subscriber
Thank you! If I set up "convection" halfway using the GUI and then plan to use APDL, will the contents in APDL overwrite the manually input settings from the GUI?
-
August 14, 2024 at 4:01 ammjmiddleAnsys Employee
In most cases, probably not unless you were careful to use the same IDs written by Mechanical, such as real constants, element type IDs, etc...
The loads you define by APDL will usually be separate and additional from what Mechanical writes.
But there could be some conflict applying the same type of load on the same nodes or elements.
-
August 21, 2024 at 2:55 amzzhang868Subscriber
Thanks! I am wondering if it’s possible to use APDL to set up "Analysis Settings" directly, instead of manually entering the "Number of Steps" and "Step End Time" in the GUI. When dealing with many time steps, setting up the "Step End Time" for each step manually can be time-consuming. If it is doable, could you please share a detailed procedure to avoid any conflicts between the GUI and APDL?
-
August 21, 2024 at 5:22 ammjmiddleAnsys Employee
Not really if you have multiple load steps, and it sounds like the reason you want to do this is because you have a large amount of load steps. You would need to completely replace all the time stepping and solve commands in APDL. You could use a *DO loop for this. This will overide all the solve commands that Mechanical writes for each load step and could really mess things up with your loading for any loading that changes between load steps, such as activation state of loads/supports. You are better setting up the load steps in Mechanical not APDL. Check out the "Analysis Settings Importer" extension in the ACT Store:
https://catalog.ansys.com
-
August 21, 2024 at 3:07 pmzzhang868Subscriber
I see. If I’ve set up a few time steps using the GUI and then switch to using this app, do I need to clear my GUI settings, or will they be overwritten? Similarly, with APDL, if I manually input steps in the GUI, do I need to clear those settings before using APDL? Additionally, how do I clean up the settings in the GUI? Do I have to load a new module? Thanks!
-
August 21, 2024 at 5:27 pmzzhang868SubscriberI have a few questions regarding the usage of the suggested extention.In the example csv "AS.csv", we haveHowever, if I want to set "Time Stepping" to be "Off", how can I set up the left settings (e.g., time step, time integration)?I tried using the following format, but it didn’t import the settings correctly.Could you please provide a sample CSV file with "time stepping" turned off and the other follow-up settings included (i.e., the setting in the ANSYS screenshot, 2nd screenshot in this message)?Additionally, my ANSYS version is 2023R2, but the latest version of the app is from 2019. I'm not sure if this might affect the functionality of ANSYS.
Thank you so much! -
August 22, 2024 at 3:31 ammjmiddleAnsys Employee
Sorry, but free ACT extensions are not supported and I don't have great expertise with this extension. There is a doc file inside the download that contains a pdf file for instructions on how to use the extension. You can edit the extension's python file for your own needs.
Yes, it was last updated for Ansys 19.0 so may not work correctly in newer versions.
-
August 22, 2024 at 3:34 amzzhang868Subscriber
Thank you all the same!
-
-
- You must be logged in to reply to this topic.
- At least one body has been found to have only 1 element in at least 2 directions
- Error when opening saved Workbench project
- How to apply Compression-only Support?
- Geometric stiffness matrix for solid elements
- Frictional No separation contact
- Image to file in Mechanical is bugged and does not show text
- Timestep range set for animation export
- Script Error Code:800a000d
- Elastic limit load, Elastic-plastic limit load
- Element has excessive thickness change, distortion, is turning inside out
-
1406
-
599
-
591
-
550
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.