CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS

edit xml code by ANSYS WB

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 9, 2020, 08:17
Default edit xml code by ANSYS WB
  #1
New Member
 
mirkolaw
Join Date: Nov 2019
Posts: 3
Rep Power: 7
mirkolaw is on a distinguished road
I would like to ask if you could edit this XML code.
because I cannot enter each DesignPoint on my own.
If there is something like this with other CODE, Range[a:b:c]
Thanks a lot


Code:
# encoding: utf-8
# Release 19.2
SetScriptVersion(Version="19.2.120")
template1 = GetTemplate(
    TemplateName="Steady-State Thermal",
    Solver="ANSYS")
system1 = template1.CreateSystem()
geometry1 = system1.GetContainer(ComponentName="Geometry")
geometry1.Edit()
Save(
    FilePath="C:/Users/xxx/Desktop/station/stationaere.wbpj",
    Overwrite=True)
geometry1.Exit()
modelComponent1 = system1.GetComponent(Name="Model")
modelComponent1.Refresh()
model1 = system1.GetContainer(ComponentName="Model")
model1.Edit()
designPoint1 = Parameters.GetDesignPoint(Name="0")
parameter1 = Parameters.GetParameter(Name="P4")
designPoint1.SetParameterExpression(
    Parameter=parameter1,
    Expression="3*P2")
designPoint2 = Parameters.CreateDesignPoint()
parameter2 = Parameters.GetParameter(Name="P1")
designPoint2.SetParameterExpression(
    Parameter=parameter2,
    Expression="10 [mm]")
parameter3 = Parameters.GetParameter(Name="P3")
designPoint2.SetParameterExpression(
    Parameter=parameter3,
    Expression="48 [mm]")
designPoint3 = Parameters.CreateDesignPoint()
designPoint3.SetParameterExpression(
    Parameter=parameter3,
    Expression="46 [mm]")
designPoint4 = Parameters.CreateDesignPoint()
parameter4 = Parameters.GetParameter(Name="P2")
designPoint4.SetParameterExpression(
    Parameter=parameter4,
    Expression="15 [mm]")
mirkolaw is offline   Reply With Quote

Old   June 11, 2020, 06:06
Default XML is not a programming language
  #2
New Member
 
mirkolaw
Join Date: Nov 2019
Posts: 3
Rep Power: 7
mirkolaw is on a distinguished road
I just found out that XML is not a programming language, but only a text.

[https://www.padtinc.com/blog/ansys-m...-howto-part-1/ ]
But with python it is possible to write a Scripting for this.
mirkolaw is offline   Reply With Quote

Old   July 1, 2020, 07:33
Default
  #3
Senior Member
 
Gweher's Avatar
 
Gwenael H.
Join Date: Mar 2011
Location: Switzerland
Posts: 392
Rep Power: 20
Gweher will become famous soon enough
Hi Mirkolaw,

What you are referencing to is a Workbench Journal file (.wbjn). You can use Python for instance to generate the .wbjn file and change the parameters as you want to fit your needs. Then you can launch workbench in batch mode passing the .wbjn as argument and solve the different design points.

Have fun
Gweher is offline   Reply With Quote

Old   July 1, 2020, 08:10
Default
  #4
New Member
 
mirkolaw
Join Date: Nov 2019
Posts: 3
Rep Power: 7
mirkolaw is on a distinguished road
Quote:
Originally Posted by Gweher View Post
Hi Mirkolaw,

What you are referencing to is a Workbench Journal file (.wbjn). You can use Python for instance to generate the .wbjn file and change the parameters as you want to fit your needs. Then you can launch workbench in batch mode passing the .wbjn as argument and solve the different design points.

Have fun
oh thank you so much
that's really a very helpful idea.
I'll try it
mirkolaw is offline   Reply With Quote

Reply


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 run multiple cycle pulsetile flow simulation in Ansys fluent using UDF code? Md Al Amin Sheikh Fluent UDF and Scheme Programming 4 January 28, 2020 12:55
ANSYS not responding when I edit Engineering Data sacrover ANSYS 10 July 26, 2018 18:23
The ansys cfx solver exited with return code -1 michellemay1993 CFX 1 September 27, 2016 03:44
Fotran code in Ansys CFX Abhishek Chitvar CFX 0 December 20, 2008 12:19
Reading ANSYS mesh into my own code Soheyl CFX 1 June 18, 2007 19:51


All times are GMT -4. The time now is 13:03.