TAGGED: Add Material
-
-
August 19, 2024 at 4:43 pmzzhang868Subscriber
Hello,
I was wondering if there's a way to change material properties via APDL in ANSYS Mechanical, rather than manually adjusting them through the "Engineering Data Sources" in Workbench. Any guidance on this would be greatly appreciated.
-
August 20, 2024 at 7:36 amDeepakAnsys Employee
Hi,
Yes, you can change the material properties by adding the following command line,Â
MP,DENS,1,5.2, ! tonne mm^-3MP,EX,1,1000, ! tonne s^-2 mm^-1MP, NUXY,1,0.3,Âplease refer to the below image: you can observe the change in deformation.Please Refer: MP (ansys.com)
Thanks,
Deepak.
-
August 21, 2024 at 1:07 amzzhang868Subscriber
Thank you so much! If I have many parts, for example, 100 identical parts, but with different material properties, how can I use APDL to assign new materials to each part more effectively? In the current example, we only have two parts, but what if the number of parts is much larger? Can we still use a single APDL to change materials for all parts?
-
August 21, 2024 at 3:28 pmDeepakAnsys Employee
Yes, u can do that,
First assign the materials to all individual parts and note the list of material ID numbers. (Note Material ID can be found in solver files)
In MP command, u can call specific material by its ID number and change the material properties.
Thanks.
-
August 21, 2024 at 3:42 pmzzhang868Subscriber
Question 1: When you say "First assign the materials to all individual parts," do you mean to do this via the GUI or APDL?
Question 2: How do I find the ID of each part?
Question 3: Could you please provide a sample code in APDL for assigning different materials to 3 parts, where each part has a different material (Material 1, Material 2, and Material 3)?Question 4: I’m wondering if this is the correct way (in the screenshot) to find the part ID.
Question 5: However, since I have many parts in different locations, is there an easier way to identify the IDs without manually checking each part? Currently, I can only see the part names, and since I created them using copy and paste, they all have the same name.Question 6: Could you also provide an example of how to change the material properties for a specific part?
Question 7: If the material properties are generated from a Gaussian distribution (with a given mean and variance), how can this be implemented using APDL?
Many thanks for your kind help!-
August 21, 2024 at 4:43 pmDeepakAnsys Employee
1) Yes, using the GUI.
2) Material data is stored in the material ID. You can find in the .dat file. Open this file in notepad.
3) MP,,ID,, --> Change the ID number.
MP,DENS,1,5.2, ! tonne mm^-3MP,EX,1,1000, ! tonne s^-2 mm^-1MP, NUXY,1,0.3,ÂMP,DENS,2,5.2, ! tonne mm^-3MP,EX,2,1000, ! tonne s^-2 mm^-1MP, NUXY,2,0.3,4&5) Those are element IDs, in this case no need to use them.-
August 21, 2024 at 4:51 pm
-
-
-
August 21, 2024 at 3:53 pmzzhang868Subscriber
Question 8: What is the difference between material ID and part ID? If they are not the same, could you please show how to find both in ANSYS in an effective way? Thanks!
-
August 21, 2024 at 5:01 pmDeepakAnsys Employee
All the material properties of one specific material are stored in a material ID. Please go through this course: Intro to Ansys APDL Scripting in Mechanical | Ansys Courses it helps in understanding the background of APDL and how it works. And you can use the ansys help documentation Theory Reference (ansys.com)
-
-
August 21, 2024 at 5:01 pmzzhang868Subscriber
I have 100 identical parts with the same material property "X" set up in the GUI. I want to slightly modify the value of "X" for all parts. Based on your feedback, I can locate the ID of material property "X" and adjust it.
Question 9: Since I have many parts, I want to change "X" for all parts efficiently. Is it possible to use APDL to modify "X" for all parts within a single script, perhaps by using a loop, instead of creating an individual APDL script for each part?
Question 9.1: If so, I assume we need to obtain the ID of each part. How can we retrieve the ID of each part, along with visualization to identify each one from the interface?
Question 9.2: How would I write an APDL script to handle this scenario?
Thank you so much!-
August 21, 2024 at 5:08 pmDeepakAnsys Employee
Here 100 parts are assigned with a material ID of "X". As we are changing the "X" value, the changed value will be applicable for all 100 parts. No need for a part ID. In a single command, you can do it.
X be the Material ID.
MP,DENS,X,5.2, ! tonne mm^-3MP,EX,X,1000, ! tonne s^-2 mm^-1MP, NUXY,X,0.3,-
August 21, 2024 at 5:25 pmzzhang868Subscriber
To clarify my request, I want each part to have a slightly different value of X, instead of assigning the same X value to all parts simultaneously. For example, if X is set to 100, I would like to assign 100.1 to part 1, 100.2 to part 2, and so on.
Could you please provide a sample APDL commands for this case? Many thanks!
-
August 21, 2024 at 5:35 pmDeepakAnsys Employee
Then u need 100 material IDs for 100 parts, right? .Only specific value can be stored in one material ID.
Â
-
August 21, 2024 at 5:38 pmzzhang868Subscriber
I got your point. Thank you very much for your time and kind help! I will have a try.
-
-
-
August 23, 2024 at 10:49 pmzzhang868Subscriber
-
August 29, 2024 at 6:38 amDeepakAnsys Employee
No, it depends on the way you can assign the material to geometry in the mechanical.Â
you can use the *DO loop to change the material properties,
There was only one material in engineering data and four solids in the model, a unique material ID will be generated for all solids based on the order of solids in geometry in mechanical outline.
e = 200000000000 !Youngs Modulus Pa
*DO, i, 1, 4, 1
  x=e+(1000000000*i)
  MP, EX, i, x,
*ENDDORefer: *DO (ansys.com)
Thanks
Deepak
-
-
- 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.