Hello everyone,
I am trying to define a user defined results to post-process my 2D FEA thermal simulation on Ansys Mechanical. For that, I have two temperature fields which are calculated and identified respectively as T1 and T2. Consequently, I can define my user defined results with the following expression :
DataModel.GetObjectsByName("Results")[0].Expression = r'abs((T2-T1)/0,1)'
It works very well so great !
However, I would like to be able to change the 0.1 at the denominator thus my question : how use a variable in an expression used in a script ?
In Python, I know that I can write the following :
DataModel.GetObjectsByName("Results")[0].Expression = f'abs((T2-T1)/{Valeur})'
Unfortunately, when I use the previous formulation, I have a mistake which appears and which says that it is not recognized by Mechanical...
Any idea how can I fix it ?
THANK YOU !
Pierre