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

[ANSYS Meshing] Automatic mesh generation by batch file

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

Like Tree1Likes
  • 1 Post By Nigirim

Reply
 
LinkBack Thread Tools Display Modes
Old   September 19, 2013, 17:36
Default Automatic mesh generation by batch file
  #1
New Member
 
Neal
Join Date: Sep 2013
Posts: 2
Rep Power: 0
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, 02:28
Default
  #2
New Member
 
Join Date: Sep 2012
Posts: 26
Rep Power: 4
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 Export fluent mesh via script

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

Old   September 20, 2013, 08:11
Default
  #3
Member
 
vidyanand
Join Date: Nov 2011
Location: bangalore,india
Posts: 66
Rep Power: 8
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, 13:28
Default
  #4
New Member
 
Neal
Join Date: Sep 2013
Posts: 2
Rep Power: 0
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, 12:15
Default
  #5
New Member
 
Join Date: Sep 2012
Posts: 26
Rep Power: 4
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
Nigirim is offline   Reply With Quote

Old   April 1, 2014, 18:59
Default
  #6
Senior Member
 
Join Date: Apr 2014
Location: Melbourne
Posts: 182
Rep Power: 3
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
Kapi is offline   Reply With Quote

Reply

Tags
batch, geometry preparation, mesh generation

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
how to calculate mass flow rate on patches and summation of that during the run? immortality OpenFOAM Post-Processing 82 November 25, 2014 14:16
Error bulding swak4Foam sfigato OpenFOAM Installation 18 August 22, 2013 12:41
mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 12 December 12, 2011 05:16
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 00:15.