Set convection quantities with script in Ansys Mechanical

PierreLCV
PierreLCV Member Posts: 35
10 Comments Name Dropper
**
edited April 3 in Structures

Dear Ansys Community,
I need to set my case with Mechanical Script and everything is fine except the convection boundary which is tricky !
Could you please indicate me how set the following quantity with Mechanical Script :

Thermal transfert coefficient : Tabular

Coefficient Type : Wall temperature

Independent Variable : Temperature

Except these last points, i have been to set the all relevant quantities (heat flux values, temperature...) with the script but I do not find the way to set these previous quantities...

Thank you for your help !
Best regards,
Pierre

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 867
    500 Comments Photogenic Name Dropper Solution Developer Community of Practice Member
    ✭✭✭✭

    For the convection boundary condition, this post should help: https://discuss.ansys.com/discussion/3115/how-to-define-convection-coefficient-at-different-load-steps-via-scripting?utm_source=community-search&utm_medium=organic-search&utm_term=
    However the options seems to be different to the ones you are listing:

    Can you please confirm that it is a convection boundary condition that you want to define?

  • PierreLCV
    PierreLCV Member Posts: 35
    10 Comments Name Dropper
    **

    Dear Pernelle,
    Thank you very much for your reply !
    Basically, I have an Ansys Mechanical simulation for which I always have the same kind of boundary conditions (heat flux imposed on one side and a convection on the other side). Consequently, I always keep the same file with the same boundary conditions and fill them in according to the case to be simulated. However, it appears that sometime (I do not know why), the convection Thermal Transfert Coefficient change from Tabular Data (which I want) to constant value (which I do not want). In the same way, during loop the independent variable is sometime changed from temperature to time which makes the script crashs...
    That is why, I would like to add to my script some line to be sure at each modification of the boundary convection that the appropriate Thermal Transfert Coefficient (Tabular is selected) as well as Coefficient Type = Wall temperature & Independent Variable = Temperature. Thus avoiding the simulation crash when I try to fill my boundary convection tabular but it switched to constant type...

    I hope I have been clear !
    THANK YOU !
    Pierre

  • PierreLCV
    PierreLCV Member Posts: 35
    10 Comments Name Dropper
    **

    Hello everybody,
    If someone encounter the same issue, I have been to fix all the issues except set the thermal transfert coefficient with a tabular (I was not able to find the relevant command). However, for the Coefficient Type and Independent Variable, use the following commands :
    1) To impose the temperature as the independent variable

    DataModel.GetObjectsByName("Convection_2")[0].IndependentVariable = LoadVariableVariationType.Temperature

    Of course in the last command, the boundary condition is named "Convection 2"

    2) To impose the surface temperature as the type of coefficient

    DataModel.GetObjectsByName("Convection_2")[0].CoefficientType = LoadVariationSubOption.SurfaceTemperature

    Maybe someone from Ansys will be able to answer regarding how impose the tabular data for the thermal transfert coefficient...

    Best regards,
    Pierre

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 867
    500 Comments Photogenic Name Dropper Solution Developer Community of Practice Member
    ✭✭✭✭

    @AKD-Scripting-Team can someone with a knowledge of therma analyses have a look here? Thank you