CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ANSYS Meshing & Geometry (https://www.cfd-online.com/Forums/ansys-meshing/)
-   -   [ANSYS Meshing] How to force meshing to create a mesh in .msh (https://www.cfd-online.com/Forums/ansys-meshing/167129-how-force-meshing-create-mesh-msh.html)

potofus February 24, 2016 03:05

How to force meshing to create a mesh in .msh
 
Hello everyone

My goal is to make a parametric study of a geometry, and mesh this geometry whatever the configuration.
In the end i MUST have a .msh file without connecting my mesh to a Fluent module (i could but i will consume computing time)

In meshing i set my preference to "CFD" and prefered solver "fluent" but in the end i have a .mshdb and not a .msh file

How can i force meshing or workbench to give me a .msh file for each configuration ?

Many thanks in advance

jan

Kapi February 24, 2016 23:25

export is as .msh file?

potofus February 25, 2016 02:41

my loop (geometry => mesh => parameter => geometry) is generating autmatically .mshdb files and not .msh as i would like. Should it be ?

Kapi February 26, 2016 00:14

post your script please!

potofus February 26, 2016 08:45

1 Attachment(s)
here it is :) i connected my mesh to a fluent but i don't need the fluent result, and it is slowing the process. My goal is to make the same without fluent and have in the end a mesh with .msh extension and not .mshdb

thank you

Kapi February 28, 2016 16:36

just double - click on your mesh, generate the mesh and then go to File>Export and export it as .msh file.

potofus March 7, 2016 08:43

Thank you for your answer Kapi, but i am afraid i did not make myself clear :

Indeed a manual action in the Export menu can be a solution, but i want to find another solution that will avoid the manual solution for each design point considering i have more than 50 design point ( so manually can be long, and i may do 50 other DP for another geometry)

So to avoid this i found a temporary solution => connect my mesh to Fluent , it "forces" Meshing to create a .msh instead of a .mshdb , but Fluent draws computation time uselessely considering i don't want any output from fluent, just my .msh

Hence my question can i have a .msh without using Fluent AND the manual action File=>Export

Sorry if i was imprecise, and again thank you for your time

Kapi March 7, 2016 17:07

Hi Jan,

you have to create a "try.wbjn" file and run it for that.
something of this sort:
Code:

mshPath=  r"C:\Users\......\try.msh"
# encoding: utf-8
SetScriptVersion(Version="16.0")
template1 = GetTemplate(TemplateName="Mesh")
system1 = template1.CreateSystem()
mesh1 = system1.GetContainer(ComponentName="Mesh")
mesh1.Edit()
script = open('mymesh.js', 'r')
mesh1.SendCommand(Command=script.read())
script.close();
mshPath = mshPath.replace('\\', '\\\\')
command2Send = """DS = WB.AppletList.Applet("DSApplet").App;
var meshBranch = DS.Tree.FirstActiveBranch.MeshControlGroup;
var filename = "%s";
DS.Script.doFileExport(filename);""" %(mshPath)
mesh1.SendCommand(Command = command2Send)
mesh1.Exit()

The only problem I see how you will give command to run it.
to run this file you have to create ".bat" file and give command to run the above file.
something like this:
Code:

"C:\Program Files\ANSYS Inc\v160\Framework\bin\Win64\RunWB2.exe" -I -R try.wbjn
so you have to create bat file, and run wbjn file to export your mesh as .msh file.

if you are creating mesh very often , I would suggest take path of doing scripting and automate your process.

Hope it helps

Cheers
KAPI

potofus March 8, 2016 03:30

thanks a lot Kapi !
i am trying this and i am coming back to you

coyote August 20, 2021 02:43

Did you achieve to do this ? I am trying to do the same thing and can't seem to save the file, or at least I cannot find it in my computer...Could you please help me ?


All times are GMT -4. The time now is 14:12.