CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS

In Workbench Mechanical, create a script to import external loads

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   April 20, 2017, 18:05
Default In Workbench Mechanical, create a script to import external loads
New Member
Join Date: Apr 2017
Location: Canada
Posts: 1
Rep Power: 0
grahamrigs is on a distinguished road
Hello everyone,

So I'm working on a simulation in Workbench transient thermal that involves a tumbling satellite's thermal radiation loads. The only way I have to simulate the earth and sun moving around is to have a sphere surrounding the satellite and varying the temperature profile for each of the sphere's faces.

I have a python script which simulates the motion and creates temperature profiles for each of the 250 faces automatically, this is then exported to properly formatted .xml files for import into Mechanical.

In ANSYS Mechanical all of these temperature loads need to be imported in. This involves creating a new temperature, setting it to the correct named selection (these have already been made correctly using a strict naming scheme), then changing the magnitude to import .xml data, navigating the new popup window to the correct file and loading within the file, and finally importing it. To do this for each of the faces takes several hours of tedious clicking.

I've been trying to create a script to automate this process. So far I've been able to get it to properly create new temperature loads and apply it to whatever named selection I want. Additionally I could set it to constant magnitudes, but I need transient loading. What I can't figure out is how to automatically import the data file to this new temperature load.

This is the code that I'm currently working with, made as best I could from online sources and guides.

var oScript = DS.Script;
var Branch = DS.Tree.FirstActiveBranch;
var Env = Branch.Environment;


ListView.ActivateItem("Scoping Method");
ListView.ItemValue = "Named Selection";

ListView.ActivateItem("Named Selection");
ListView.ItemValue = "sphere_face_01_01";
I haven't found anything online to help with the rest of the problem. Even if the script is only able to open the dialogue window , requiring the user to select the right file and importing, and then immediately opening the window for the next one would speed the process up immensely.

What could also work is the script reads the data files directly and puts that into tabular data, sidestepping the import window entirely.

Can anyone shed some guidance on this? I've tried finding the functions to do this by examining the background .xml and .js files, but can't find anything relevant. I'm using Windows if that's at all relevant.
grahamrigs is offline   Reply With Quote


import data, mechanical, scripting, workbench

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to set periodic boundary conditions Ganesh FLUENT 14 November 26, 2018 11:26
[blockMesh] Include list of points Hikachu OpenFOAM Meshing & Mesh Conversion 0 June 20, 2011 09:03
Actuator disk model audrich FLUENT 0 September 21, 2009 07:06
Where's the singularity/mesh flaw? audrich FLUENT 3 August 4, 2009 01:07
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55

All times are GMT -4. The time now is 02:47.