|
[Sponsors] |
In Workbench Mechanical, create a script to import external loads |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 20, 2017, 19:05 |
In Workbench Mechanical, create a script to import external loads
|
#1 |
New Member
Graham
Join Date: Apr 2017
Location: Canada
Posts: 1
Rep Power: 0 |
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. Code:
var oScript = DS.Script; var Branch = DS.Tree.FirstActiveBranch; var Env = Branch.Environment; oScript.SelectItems(""+Env.ID) oScript.doInsertEnvironmentKnownTemperature(); //oScript.doEditRename(); ListView.ActivateItem("Scoping Method"); ListView.ItemValue = "Named Selection"; ListView.ActivateItem("Named Selection"); ListView.ItemValue = "sphere_face_01_01"; 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. |
|
Tags |
import data, mechanical, scripting, workbench |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
[blockMesh] Include list of points | Hikachu | OpenFOAM Meshing & Mesh Conversion | 0 | June 20, 2011 10:03 |
Actuator disk model | audrich | FLUENT | 0 | September 21, 2009 08:06 |
Where's the singularity/mesh flaw? | audrich | FLUENT | 3 | August 4, 2009 02:07 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |