How to create a new material in AEDT using PyAEDT?

ansys-satyajeet
ansys-satyajeet Member, Employee Posts: 14
Photogenic First Anniversary Ansys Employee First Comment
✭✭✭

How do I create a new material and assign values for density and specific heat using PyAEDT?

Tagged:

Best Answer

  • ansys-satyajeet
    ansys-satyajeet Member, Employee Posts: 14
    Photogenic First Anniversary Ansys Employee First Comment
    ✭✭✭
    Answer ✓

    If you must assign properties for density and specific heat, please see the code lines below. It is a good practice to check if the material already exists before creating a new one.

    if not ipk.materials.checkifmaterialexists("matname"):
        mat = ipk.materials.add_material("matname")
        mat.thermal_conductivity = "400"
        mat.mass_density = "8000"
        mat.specific_heat = "700"