CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > ANSYS Meshing & Geometry

[DesignModeler] find features of Gambit in DesignModeler

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

Like Tree2Likes
  • 1 Post By sac
  • 1 Post By rohit_8481

Reply
 
LinkBack Thread Tools Display Modes
Old   January 31, 2011, 04:41
Default find features of Gambit in DesignModeler
  #1
New Member
 
fatma
Join Date: Jan 2011
Posts: 9
Rep Power: 6
code_source is on a distinguished road
Hello
I am a new user of DesignModeler, I always worked with Gambit. I have a geometry that I did with Gambit (.jou) and I want to reproduce it in DesignModeler. I have some difficulties which block me :
1 / How to move, union and subtract volumes (features "move", "unite" and "subtract" in Gambit)?
2 / How to reproduce:
Code:
edges round "edge.1" "edge.2" radius1 0.002
 volume blend
 edge create project "edge.2" face "face.1" vector 0 0 1
 face create skin "edge.12" edge.21 "directions 0 0
 face split "face.10" connected keeptool face "face.29"
 smooth face
on DesignModeler?

Thank you a lot for your help
code_source is offline   Reply With Quote

Old   January 31, 2011, 09:21
Default
  #2
sac
Member
 
Join Date: Jun 2010
Posts: 44
Rep Power: 8
sac is on a distinguished road
Quote:
Originally Posted by code_source View Post
Hello
I am a new user of DesignModeler, I always worked with Gambit. I have a geometry that I did with Gambit (.jou) and I want to reproduce it in DesignModeler.
All of your questions are covered in the DM Training. If you've not been on it then I suggest you do.

Quote:
I have some difficulties which block me :
1 / How to move, union and subtract volumes (features "move", "unite" and "subtract" in Gambit)?
Under the create menu:

  • Union, Subtract are boolean operations.
  • Move is a body operation.

Quote:
2 / How to reproduce:
Code:
edges round "edge.1" "edge.2" radius1 0.002
 volume blend
 edge create project "edge.2" face "face.1" vector 0 0 1
 face create skin "edge.12" edge.21 "directions 0 0
 face split "face.10" connected keeptool face "face.29"
 smooth face
on DesignModeler?

Thank you a lot for your help
Blend is under the create menu.
Projection is under the tools menu.
Face split is under the tools menu.
dibetao likes this.
sac is offline   Reply With Quote

Old   January 31, 2011, 09:42
Default
  #3
New Member
 
fatma
Join Date: Jan 2011
Posts: 9
Rep Power: 6
code_source is on a distinguished road
thank you (sac) very much for your reply, it helped me a lot.
Do you have a DM Training that you advise me?
code_source is offline   Reply With Quote

Old   February 1, 2011, 10:29
Default
  #4
sac
Member
 
Join Date: Jun 2010
Posts: 44
Rep Power: 8
sac is on a distinguished road
Quote:
Originally Posted by code_source View Post
thank you (sac) very much for your reply, it helped me a lot.
Do you have a DM Training that you advise me?
You can either do local or online courses (or find a local reseller doing the same):

http://www.ansys.com/Support/Training+Center
sac is offline   Reply With Quote

Old   February 1, 2011, 21:23
Default
  #5
Senior Member
 
PSYMN's Avatar
 
Simon Pereira
Join Date: Mar 2009
Location: Ann Arbor, MI
Posts: 2,662
Blog Entries: 1
Rep Power: 36
PSYMN has a spectacular aura aboutPSYMN has a spectacular aura about
There is even a course on the customer portal specifically for Gambit users moving over to DM. It redoes all the Gambit tutorials using the DM tool.

Simon
PSYMN is offline   Reply With Quote

Old   April 7, 2011, 13:47
Default
  #6
New Member
 
Roberto Lima
Join Date: Apr 2011
Location: Ceará, Brazil
Posts: 3
Rep Power: 6
dibetao is on a distinguished road
Can I do boolean operation by python scripting?
dibetao is offline   Reply With Quote

Old   April 8, 2011, 09:12
Default DM is persistent, no script needed.
  #7
Senior Member
 
PSYMN's Avatar
 
Simon Pereira
Join Date: Mar 2009
Location: Ann Arbor, MI
Posts: 2,662
Blog Entries: 1
Rep Power: 36
PSYMN has a spectacular aura aboutPSYMN has a spectacular aura about
Do you mean a geometry operation?

Python is for the schematic, within each application you must use the scripting method of the application. If you are talking about doing a Boolean in DesignModeler, then you would do it the way DM does it... With persistence instead of a script.

In other words, you don't need a script... Just do it in DM and if you later make upstream adjustments, DM can still update and perform the Boolean, just like a script would.

Best regards,

Simon
__________________
-----------------------------------------
Please help guide development at ANSYS by filling in these surveys

Public ANSYS ICEM CFD Users Survey

This second one is more general (Gambit, TGrid and ANSYS Meshing users welcome)...

CFD Online Users Survey
PSYMN is offline   Reply With Quote

Old   April 8, 2011, 10:22
Default
  #8
New Member
 
Roberto Lima
Join Date: Apr 2011
Location: Ceará, Brazil
Posts: 3
Rep Power: 6
dibetao is on a distinguished road
Thanks for reply, Simon.

I really need to do a script with boolean operation in DM. My script is wrote in python, and it reads a file of many circles and one box (2D). My geometry is complex, and I need to cut the circles of the box. So, I have to use the substract operation. I can load the box and circles by a script, and I can cut them by mouse selection (menu, boolean operation set).

However, I still don't know how make all proccess automatically through a script. I need to do that because my analysis requires many samples. Each sample is made of many circles. So, that proccess could speeds up my work.
dibetao is offline   Reply With Quote

Old   April 8, 2011, 10:43
Default
  #9
Senior Member
 
PSYMN's Avatar
 
Simon Pereira
Join Date: Mar 2009
Location: Ann Arbor, MI
Posts: 2,662
Blog Entries: 1
Rep Power: 36
PSYMN has a spectacular aura aboutPSYMN has a spectacular aura about
Sorry, I don't know.
__________________
-----------------------------------------
Please help guide development at ANSYS by filling in these surveys

Public ANSYS ICEM CFD Users Survey

This second one is more general (Gambit, TGrid and ANSYS Meshing users welcome)...

CFD Online Users Survey
PSYMN is offline   Reply With Quote

Old   July 24, 2011, 07:22
Default
  #10
New Member
 
Rohit Vasudevan
Join Date: Feb 2011
Location: Southampton
Posts: 9
Rep Power: 6
rohit_8481 is on a distinguished road
Hey Dibetao... U can make the process automatic by using a Javascript... For the circle sketches u can simply make Design Modeler write out sketches of active planes. While for the operation u need simple bits of code like this:

var XYPlane = agb.GetXYPlane();
agb.SetActivePlane(XYPlane);
var ps1 = planeAirfoilRoot (new Object());
var plane1 = agb.PlaneFromPlane(XYPlane);
plane1.AddTransform(agc.XformZOffset, 0.50);
agb.Regen();
agb.SetActivePlane(plane1);
var ps2 = planeAirfoilTip (new Object());
var ext1 = agb.Skin(agc.Add,agc.No,0.0,0.0);
ext1.AddBaseObject(ps1.Sk1);
ext1.AddBaseObject(ps2.Sk2);
agb.Regen();

This bit of code Skins/Lofts two sketches... I suggest u link up Design Modeler to a debugger... Heres a link which might be useful:
http://www.padtinc.com/blog/post/201...ing_Part4.aspx

Best of luck
dibetao likes this.
rohit_8481 is offline   Reply With Quote

Old   October 16, 2011, 15:01
Default
  #11
Member
 
Nathan
Join Date: Aug 2010
Posts: 64
Rep Power: 7
natantyt is on a distinguished road
@ Dibetao

I have a similar problem in 3D. I'm trying to cut a packing of particles inside a box and mesh the remaining pore space. Do you have any advice on the implementation of this. how do you proceed with the subtraction in the gui. Cheers Pal!
natantyt is offline   Reply With Quote

Old   October 16, 2011, 19:17
Default
  #12
New Member
 
Roberto Lima
Join Date: Apr 2011
Location: Ceará, Brazil
Posts: 3
Rep Power: 6
dibetao is on a distinguished road
@ Natantyt

I didn't find any solution for this problem using the DM (Design Modeler - Ansys 13.0). I miss GAMBIT because of its pleasant journal file (looks like a script). But the Gambit was discontinued by the Ansys team If you find some solution for this question/problem using the DM, please, share with us here in the forum.

ps: @rohit_8481 wrote something about this problem. However I didn't do yet.
dibetao is offline   Reply With Quote

Old   July 23, 2012, 12:21
Default
  #13
ANT
New Member
 
Join Date: Jun 2012
Posts: 17
Rep Power: 5
ANT is on a distinguished road
Here is the issue with this. The actual source code for these functions is (I think...) programmed in C, so they cannot be accessed directly in DesignModeler through JScripts.

However. The interface in DesignModeler, including all the clickable buttons/menus, is being generated/drawn through Javascript, which is necessary for it to function with various languages etc. without having its entire source code rewritten -- for example, if an internal function is called "CONCEPT_GIRAFFE," then they can simply use JavaScript to assign it one of many translated Strings for display in the GUI depending on the user's installation language, and when the user clicks the translated label/button, have it simply create an Event in the EventHandler that calls CONCEPT_GIRAFFE itself without depending on anything in the GUI. Similarly, someone can be programming some SAVE_USER_FILE function and program any user file selection errors to throw an exception, while the GUI/language localization team can then take the identifier of those exceptions and write translations for them that cause the resulting message to be displayed in the user's specified language ("Cannot save file to floppy drive," "Buenos dias no habla espaniol," "Je peux pas l'ecrire sur le fromage petit," etc.).

By nature of this fact, thankfully, our scripts in DesignModeler can hook into this Javascript frontend, and basically be glorified button pushers that still serve a pretty useful/effective automation routine. Problem is, with all of these functions that aren't defined in the DesignModeler Help "Scripting API" documentation, you don't have access to the functions but simply the buttons that call these functions, so programming here gets a bit creative due to the extreme lack of documentation of anything beyond the 8 simple functions listed in the Help. And by "undocumented" I mean that I haven't seen this discussed absolutely anywhere except in the context of Mechanical APDL & Workbench JScripting, which is quite different from what we need in the much-more-sandboxed DesignModeler (at least in Workbench you can record a Journal, where it stores the commands for everything you do interactively). However, using the DesignModeler's Help documentation on Scripting API as a reference to the JScript functions that you need is similarly useful to using the bible as an engineering handbook; it mentions some things that supposedly happen but doesn't describe how, it references some other things but doesn't explain how they got there, and when you try to do what it says the results usually end up skewed or backwards altogether.

In any case, as I mentioned in another post here, I was doing some searching through the ANSYS .js files for function names similar to the ones in the Help documentation to see if I could find some more of them, when I read this very intriguing line in the file agInterop.js:

Quote:
Originally Posted by agInterop.js

with (ag.wb.ScriptEngine)
{
bAddNamedItem ("ag", ag); //Provides full access, but we do not tell users about this
AddNamedItem ("agb", ag.b); //Batch command access
AddNamedItem ("agc", ag.c); //Batch constants access
RunScript (scriptPath);
}
To summarize what I said in that other post, I assume that the classes ag.b and ag.c are being clumped together as "agb" and "agc" for the purposes of limiting user Scripting control to batch commands and batch constants, and some of the *real* functions must be listed somewhere in the ANSYS directory as "ag.b.xxxxxx" and the full set of constants must be listed somewhere as "ag.c.yyyyyyyyyyy". And, sure enough, I found the two files agEventHandler.js and agConstants.js which listed a very large amount of "full access" functions and a long list of constants, respectively. Both are located in the folder "C:\Program Files\ANSYS Inc\v140\aisol\AGP\AGPages\scripts\", and you can read their contents by opening either of them with Notepad (or Notepad++, which is to Notepad what the SR-71 Blackbird is to a Cessna).

Note also that the quoted snippet above is also found in the file agMenu.js, and throws an event when the "File > Run Script" Menu item is clicked by a user in DesignModeler, except this one has the added comment: "//Change of plans! Let's run the Begin/End user script function here so it does not need to be in user scripts!" This is a good programming decision, because then the user is not awkwardly presented with any "ag.m.__________" commands at the top of their script file when the ANSYS guys are trying to sandbox JScripting in DM to "agc" and "agb" only. I don't at all mean that ANSYS is trying to keep users in the dark about these added functions, since it's probably a good idea: having "full access" to the scripts is not the best thing since it would mean they'd have to somewhat support it, and using these scripts to hook into UI elements is somewhat like building a keyboard-controlled robot whose main function is to type on a keyboard. They're somewhat difficult to control with JScript alone, without proper access to the C++ backend, by my view is, if it's there, why not use it to speed things up a bit.

Now, to get to the point about booleans, there is a command in agEventHandler.js that response to the event thrown by clicking on the Boolean button and then clicking Generate immediately after. In fact, all of the "ag.gui.xxxxxxxxx()" functions that I've tested behave this way; they run and then self-Generate immediately. When dealing with "agb.xxxxxxx" functions, you'd have to type the "agb.Regen()" method after every new Concept/Sketch/etc. that you scripted but I forgot to add the "Regen()" when using the "ag.gui.xxxxxxxxx()" methods and they worked fine. Anyways, the command is here:

ag.gui.CreateBoolean();

If you open up notepad to a blank document, paste that command in, save the document with any funky name you want but with the .js extension, then go into DesignModeler and select File > Run Script, and then browse for the file and click Open, you will see that a Boolean has been created in your Tree Outline. However, this Boolean object has nothing assigned. If you have a selection of bodies generated beforehand (I don't know how to select bodies yet, only lines & points) it will probably assign the default Unite operation and then quickly Generate itself, but there should be a way to pseudo-click the "Operation" field and select Difference, and there should definitely be a way to select Bodies (easiest way is likely through the Tree Outline, but I'll need to do some more snooping).

I am currently checking around for how to access the events thrown when a user clicks within the Details View so I can quickly assign the "Operation," "Target Body," and "Tool Bodies settings", but for now this post has gotten long enough.

P.S. If anyone else has been looking through anything I've mentioned in this post, please let me know. I'm not exactly Alan Turing here, so any help would be appreciated.

Edit: One selection function is: agb.AddSelect(type, item); where "type" is in the form of a constant from agConstants.js (e.g. ag.c.TypeVertex) and a way to assign a selected body to a variable is to use:

var body = ag.m.SelectionMgr.GetSelectedBody();

Also useful for getting various parameters are:

ag.m.SelectionMgr.getSelListSize(); //Gets number of items that are currently selected

Last edited by ANT; July 23, 2012 at 15:03.
ANT is offline   Reply With Quote

Old   April 30, 2014, 07:33
Default
  #14
New Member
 
Join Date: Feb 2014
Posts: 2
Rep Power: 0
Blunaigel is on a distinguished road
Hello ANT,

have you made any progress with the boolean command.
I'm especially interested in creating a boolean operation (substract) with one target body and multiple tool bodies.
Blunaigel is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30
Gambit via X11 Josh Kjenner FLUENT 1 January 24, 2006 20:21
Creatingfan blade profile in GAMBIT Jenny FLUENT 5 April 28, 2005 05:52
Gambit batch - kill "Startup" box how? Chris Bailey FLUENT 2 February 23, 2005 10:05
Illegal segmentation error in gambit Rob FLUENT 1 February 21, 2005 08:31


All times are GMT -4. The time now is 16:43.