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

[ANSYS Meshing] Automatic mesh generation by batch file

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By Nigirim
  • 1 Post By Nigirim
  • 1 Post By Kapi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 19, 2013, 18:36
Default Automatic mesh generation by batch file
  #1
New Member
 
Neal
Join Date: Sep 2013
Posts: 4
Rep Power: 13
nealrm is on a distinguished road
I currently have a parameterized geometry and mesh file in work bench that I change the parameters on to run multiple cases. I would like to instead have a batch file that generates the geometry and mesh for me with named selections that can be imported by another batch file into a CFX Pre and run by command lines in a third batch file.

I have a starting point to look at the coding for the Pre and solver batch files because i can use the command line editor in Pre. I am somewhat lost as to where to find information on generating geometry and mesh from a batch command. Any suggestions where to look or directions to some appropriate guides would be appreciated.
nealrm is offline   Reply With Quote

Old   September 20, 2013, 03:28
Default
  #2
New Member
 
Join Date: Sep 2012
Posts: 26
Rep Power: 14
Nigirim is on a distinguished road
Hello Neal,

I don't know if you have found this site, that describes how to work with workbench and excel. http://www.padtinc.com/blog/the-focu...el-with-python

You can use the same technique using batch files. But working with parameterized geometry and mesh i prefer using excel.

If you want to automatize the generation of Mesh and Geometry from the scratch you will have to use JScript for Designmodeler and Mesher, which is barely documented.
Regardless if you just want to change your parameters, update your geometry and mesh, export it as .meshdat and start the simulation you can use the IronPython from Workbench, which is documented in the ANSYS help.
If you want to export it in the mesh in another format please take a look here http://www.cfd-online.com/Forums/ans...ia-script.html

Greets
Nigirim
evan247 likes this.
Nigirim is offline   Reply With Quote

Old   September 20, 2013, 09:11
Default
  #3
Member
 
vidyanand
Join Date: Nov 2011
Location: bangalore,india
Posts: 66
Rep Power: 18
Vidyanand Kesti is on a distinguished road
paramtrci model is easy Design model becuase it directly linked with excel or you can make parmetric model easily,if its prameter in CAD geometry then A complier is require to transfer the parameter from CAD to Design modeler,Even ANSYS mesh also content the parametric mesh (like size fuction ),even you can parmeter in FLUENT for BC
Vidyanand Kesti is offline   Reply With Quote

Old   September 23, 2013, 14:28
Default
  #4
New Member
 
Neal
Join Date: Sep 2013
Posts: 4
Rep Power: 13
nealrm is on a distinguished road
The way i understand the link you provided it requires workbench already being open and i start doing things in workbench. This will not work for what i need. I need to have a third program start workbench or the individual components and pass information to them to update to a new geometry and mesh file. Using excel shouldnt be an issue but im not sure how to have my third program start the journal file/script execution in workbench.

(the third party software is called Isight by 3DS and is being used for optimization)
nealrm is offline   Reply With Quote

Old   September 24, 2013, 13:15
Default
  #5
New Member
 
Join Date: Sep 2012
Posts: 26
Rep Power: 14
Nigirim is on a distinguished road
Hi nealm,

you can start Workbench via batch file, load a workbenchproject and run a script.
Code:
 
   retval = Shell(“C:\Program Files\Ansys Inc\V130\Framework\bin\win64\runwb2 \ 
            -X -R updateWB2.py -F ExcelTower1.wbpj”, vbNormalFocus) 
   End Sub
This is from Visualbasic but I think it should work for batchfiles too.

-F PATH should open a workbenchprojectfile,
-R PATH should run a journal or pythonscript after workbench is started
-X closes Workbench and all other Workbenchapplications if the journal or pythonscript is done.

The pythonscript can open and close every Workbenchapplication, update the project and all the other stuff Workbench is able to do.
Regarding Python or journals, this is documented in ANSYS Help.

If you want to change something in Designmodeler or the Mesher you need to use JScript macros for those two, this is not documented by ANSYS.

Hope this helps
Greets
Nigirim
usamatoson likes this.
Nigirim is offline   Reply With Quote

Old   April 1, 2014, 19:59
Default
  #6
Senior Member
 
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14
Kapi is on a distinguished road
Hi Nealrm,

You can create a batch file and run the following code

"C:\Program Files\ANSYS Inc\v130\Framework\bin\Win64\RunWB2.exe" -I -R file_name.wbjn

Once you run this .bat file, it will open up a new project, go into your directory and run the specified .wbjn file you want.

Hope this helps
Cheers
Kapi
usamatoson likes this.
Kapi is offline   Reply With Quote

Reply

Tags
batch, geometry preparation, mesh generation


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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 18:22
how to calculate mass flow rate on patches and summation of that during the run? immortality OpenFOAM Post-Processing 104 February 16, 2021 09:46
[swak4Foam] Error bulding swak4Foam sfigato OpenFOAM Community Contributions 18 August 22, 2013 13:41
ParaView Compilation jakaranda OpenFOAM Installation 3 October 27, 2008 12:46
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16


All times are GMT -4. The time now is 07:55.