## General Mechanical

Topics relate to Mechanical Enterprise, Motion, Additive Print and more

#### batch mode for coupled analysis

• lschuler
Subscriber

Hi everyone,

I am trying to run an electrothermal analysis in batch mode from Matlab. I have set up my problem in worbench and mechanical. I am doing first an electrical analysis and the heat generation by Joule effect is the load of the thermal problem.

From mechanical, I have exported the input file of the electrical problem so that I can run it in batch mode. However, mechanical needs to solve the electrical problem to be able to write the thermal problem input file, because the heat generation is directly written to the input file.

The problem is that I want to run multiple simulations with changes on some parameter values. Thus the load of the thermal problem will vary. Is it a way to have mechanical import the electrical results so it can recalculate the heat generation for each simulation?

I would also like to be able to modify the electrical results (the voltage) from Matlab. So I guess the ideal solution would be to give as an input to the thermal problem an array containing the voltage of each node (or at least element) that will be the load of the thermal problem. Is it possible to do this?

I don't know if I'am making myself clear.

Thanks for the help,

Louis

• Bill Bulat
Ansys Employee
Hi Louis
One thing you should be able to do to simplify the effort is to use a thermoelectric analysis system (rather than linking Joule heat calculated from a DC current conduction analysis to a thermal analysis).
Thermoelectric analyses use coupled field element types that automate bidirectional thermoelectric coupling. This accounts (in one analysis rather than two) for the nonlinear response that results when temperature dependent electrical resistivity and/or thermal conductivity are used.
I don't know how to use MATLAB to call another executable. My guess is that you're supplying MATLAB with the ds.dat (text file) written by Mechanical. That is, you're using MATLAB to call MAPDL (the solver executable used by Mechanical to calculate results) and direct MAPDL to read in the ds.dat file written by Mechanical. If this is what you are doing, it would probably help to know how to initiate a MAPDL batch run as described in the following section in the Help:

The ds.dat is an ASCII text file that Mechanical writes. It contains commands that the MAPDL solver reads. These commands direct MAPDL to create the model (mesh, element types, material properties, boundary conditions, analysis options, etc.). If you can locate the command(s) within ds.dat that assign the excitation/BC that you want parameterized, you can edit the numerical value specified in the command and replace it with a parameter (a name you make up). You can then specify the value of that parameter in the system call to the MAPDL executable:
I would imagine that MATLAB provides a way to vary the value of the parameter referenced in the string that calls the MAPDL executable.
Best Bill

• lschuler
Subscriber
Hi Bill
I don't think that I can use a thermoelectric analysis for my problem because I need to perform the electrical analysis first before changing parameters values for the thermal analysis. Also, I would like to perform a transient thermal analysis, and it looks like a thermoelectric anaysis is a steady state one.
However, I think I found the answer to my problem with the LDREAD command, which loads the results from another analysis.

Regarding the .dat file, it is indeed what I do. I use Matlab to modify the .dat file and to call Mechanical APDL.

Best Louis
• Erik Kostson
Ansys Employee
Hi Louis
'I don't think that I can use a thermoelectric analysis for my problem because I need to perform the electrical analysis first before changing parameters values for the thermal analysis. Also, I would like to perform a transient thermal analysis, and it looks like a thermoelectric anaysis is a steady state one.'

We can convert the thermoelectric analysis in workbench/mechanical to transient by inserting the
antype,trans and
timint,on
command.

'However, I think I found the answer to my problem with the LDREAD command, which loads the results from another analysis.'

This is OK for one way coupling, for two way coupling (so say the temperatures influence the electric conduction, etc) we need the thermoelectric analysis which is fully coupled.

All the best

Erik