-
-
February 16, 2023 at 1:10 pm
Aritra Chakraborty
SubscriberHi, I am fairly new to ANSYS, and was trying to impose a particular temperature on a named selection (surface) through the "COMMANDS" option. However, I am seeing that all the nodes are getting selected instead of the particular named selection. Here's my code snippet:
temp_top = 100 ! C
ALLSEL, ALL
CMSEL,S,y_top_surfaceNSLE,S,ALL
NumNodes=0
COUNT=0
*GET,NumNodes,NODE,0,COUNT
CurNode=0
*DO,i,1,NumNodes
*GET,CurNode,NODE,CurNode,NXTH
BF,CurNode,TEMP,temp_top
*ENDDOALLSEL, ALL
Any help in figuring what I am doing wrong in the snippet would be really helpful!
-
February 16, 2023 at 6:53 pm
Sheldon Imaoka
Ansys EmployeeHi Aritra,
Is “y_top_surface” a nodal component? If so, just use
BF,y_top_surface,TEMP,temp_top
It may not be working because, if y_top_surface is NOT an element component, then NSLE selects all nodes attached to all selected elements. If all elements are still selected, then all nodes get selected, thus negating the effect of your “CMSEL” command you issued earlier.
Try just replacing everything with 2 lines:
temp_top = 100 ! C
BF,y_top_surface,TEMP,temp_topand that should do the trick.
(BTW, why are you using APDL? Are you using Mechanical?)
Regards,
Sheldon -
February 16, 2023 at 7:04 pm
Aritra Chakraborty
SubscriberHi Sheldon, I will try the above. I am using Mechanical and this is in the "Commands(APDL)" object.
Aritra
-
February 16, 2023 at 7:46 pm
Sheldon Imaoka
Ansys EmployeeHi Aritra,
In a structural analysis, you should be careful since the nodes that do not have temperature assigned will default to having the environment temperature assigned to them. This means that, if you are performing a purely structural analysis and have 100°C applied only to a surface, the rest of the body may be at 22°C. This is unrealistic and can cause artificially high stresses (in addition to wrong results).
If you expect a thermal gradient such that one surface is maintained at 100°C while the rest of the body may have heat dissipated, I strongly suggest that you perform a thermal analysis first. You can link the temperature results to a structural analysis, so the imposed temperatures will be more realistic. Please take a look at this course for more info on performing thermal analyses as well as linking results from a thermal analysis to structural analysis:
Topics in Heat Transfer Analyses - ANSYS Innovation Courses
Regards,
Sheldon -
February 16, 2023 at 7:51 pm
Aritra Chakraborty
SubscriberHi Sheldon, that is exactly what I am trying now, as in a thermal analysis first, and then I will perform structural analysis on the result. A couple of question, for thermal analysis as well if I create a "named selection" and want to assign the temperature to that selection (outer surface) is the command still
BF, named_selction, TEMP, value?
-
February 16, 2023 at 7:55 pm
Sheldon Imaoka
Ansys EmployeeHi Aritra,
No, in a thermal analysis, you can specify temperature directly on a surface in the GUI. Please review the course videos I suggested for more information on how to perform a thermal analysis. No APDL scripts are required.
(For APDL, in a thermal analysis, "D" command constraints the temperature since it is a DOF constraint; however "BF" specifies the temperature in a structural analysis since it is a 'body force' type of load. However, as noted above, you don't need to use any APDL scripting in Mechanical for what you want to do.)
Regards,
Sheldon
-
-
February 16, 2023 at 7:54 pm
Sheldon Imaoka
Ansys EmployeeHi Aritra,
To clarify my earlier response, if you have one surface at 100°C, you actually expect to have a smooth thermal gradient such that the nodes adjacent to the 100°C surface may be 95°C (as an example), then nodes further away may be 90°C, etc. If you just specify 100°C on the nodes on the surface, the adjacent nodes will have your environment temperature, which is, by default, specified as 22°C. So over a very short span, your temperature drops from 100°C to 22°C!
Since we don't know how the part may cool down away from the 100°C surface (if that surface is really maintained at 100°C), that is why you should perform a heat transfer analysis first - the temperature field outside of the 100°C surface is unknown, so we solve for that first. Once we have determined the temperature field for your entire system/assembly, Mechanical can then automatically map the temperature field in your structural analysis, so you get correct & more realistic thermal strains, stress distribution, etc.
I hope that may clarify my earlier statements on why you probably don't want to just specify 100°C on a surface. This is actually this functionality is not directly in Mechanical, as it typically doesn't make sense to specify a vertex, edge, or surface of a part to have a different temperature than the rest of the body.
Regards,
Sheldon-
February 16, 2023 at 8:07 pm
Aritra Chakraborty
SubscriberHi Sheldon, thanks a lot for the replies. I want to do via "Commands (APDL)" because the current exercise is part of a larger problem. The final goal is to specify a temperature function instead of a single value which makes applying such via APDL much convenient.
So for a named selection, I will have different temperature for different elements which is based on the coordinates, that's why I was looking for the APDL commands.
-Aritra-
February 16, 2023 at 8:11 pm
Sheldon Imaoka
Ansys EmployeeHi Aritra,
Thanks for your reply. In that case, if the built-in functionality of Mechanical doesn't serve your needs, you can use the "D" command to impose a known temperature value on nodes (or nodal component) in a thermal analysis. (BF command is only for imposing temperatures in a structural analysis.)
Regards,
Sheldon -
February 16, 2023 at 8:16 pm
Aritra Chakraborty
SubscriberHi Sheldon,
Thanks again, and, yes, I tried "D" for a simple case and that works.
Another quick question, the original mechanical geometry has some blocks that are identified as rigid bodies which probably are not supported by the thermal solver.
In that case, can i solve for the temperature field for part of the geometry and use that solution for the subsequent mechanical simulation with the full geometry (i.e., inlcuding the rigid blocks that I suppressed for the thermal solver) ?
-Aritra
-
February 16, 2023 at 9:36 pm
Sheldon Imaoka
Ansys EmployeeHi Aritra,
Yes, what you noted is possible. You can even have different meshes and only map temperatures from certain bodies from thermal to structural. Lesson 4 in the course link I shared earlier covers this near the 11:00 mark.
Regards,
Sheldon -
February 16, 2023 at 9:46 pm
Aritra Chakraborty
SubscriberHi Sheldon,
yeah I looked at the leason, and am in the process of implementing such in my model. Let's see how it fares.
Thanks,
Aritra
-
-
-
- You must be logged in to reply to this topic.

Boost 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.
- Saving & sharing of Working project files in .wbpz format
- Solver Pivot Warning in Beam Element Model
- Understanding Force Convergence Solution Output
- An Unknown error occurred during solution. Check the Solver Output…..
- What is the difference between bonded contact region and fixed joint
- whether have the difference between using contact and target bodies
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- User manual
- Colors and Mesh Display
- material damping and modal analysis
-
3850
-
2613
-
1853
-
1246
-
600
© 2023 Copyright ANSYS, Inc. All rights reserved.