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/)
-   -   [Other] ANSYS to Fluent mesh export in ASCII format (https://www.cfd-online.com/Forums/ansys-meshing/72929-ansys-fluent-mesh-export-ascii-format.html)

EphemeralMemory June 13, 2011 10:48

Hey, all, I have a question about mesh formats.

Gambit and Ansys-FLuent have different mesh formats, and I have written in the past a mesh reader in VTK, where we do some open source applications.

Ansys-Fluent meshes are a bit more complicated, however, is there any way I can get Ansys to export meshes as an Gambit-style mesh, opposed to a Ansys-Fluent style mesh?

Thanks

PSYMN June 15, 2011 11:43

The *.msh file is an actual mesh file. This is the one output from TGRID and ICEM CFD for many years, and is the one currently used by ANSYS FLUENT. Gambit can also output in this format. It has both ASCII and binary flavors (is that what you are talking about?). It has almost become a defacto neutral format in the industry and many 3rd party solvers import this format.

I am not a Gambit guy, so let me know if you think this is wrong. The Gambit Neutral file is not really a mesh file. It is more a set of instructions for gambit to build a mesh. This is why other ANSYS tools can't read it in.

So maybe we are not talking about the same stuff... What are the two "different mesh formats" that you are talking about?

EphemeralMemory June 15, 2011 12:06

Its just that a Gambit style mesh and a Ansys-FLuent style mesh have different internal structures; I cannot read it with my free source reader now because the formatting of the ASCII Mesh is very different from that of the Gambit ASCII Mesh.

I can get Ansys ICEM CFD to read a Gambit-style ASCII mesh, for instance, and export it as a Ansys-style ASCII mesh. The two files, when I look at them, have similar sections but very different formatting (which leads to reading problems).

The one problem I have is that I have developed an application that has the Gambit-style mesh in reader classes that I would not rather touch unless i had to. Is it possible to export a mesh in a older mesh format (one preferred by Gambit), or do I have to code another reader?

Thanks for responding!

cih89 July 6, 2011 06:41

Hi

This thread looks like something that could help me with this problem:

http://www.cfd-online.com/Forums/ans...ad-matlab.html

as it looks like MATLAB can read ASCII files. I have set the environment variable but now do I export from the meshing part of the workbench or from Fluent? And am I right in understanding that by choosing .msh it will then be ASCII? Sorry if these are very simple questions. I'm very new to this.

Many thanks

Alynx July 6, 2011 06:55

Hello,

look at the previous page of this discussion ;-)

JasonG explains it :
Pei,

Here are some quick steps I followed to setup my computer, hopefully this will assist you:

Step 1: Right click on "My Computer" icon from desktop, click on "Properties", click on the "Advanced" tab, and then click on "Environment Variabls".

Step 2: Under "User Variables for __" click "New", a box should pop up. Fill out the following:

Variable name: AWP_WRITE_FLUENT_MESH_ASCII
Variable value: 1

Step 3: Click "ok" on all the windows to close out of the system properties.

Step 4: Once in the meshing applet of workbench, go to "File" -> "Export", and then select the ".msh" option.

This should export the fluent file in the correct format, and should translate all components (as long as none are overlapping).

cih89 July 6, 2011 07:01

Thanks for your reply, I realised that just after posting and have now changed what I said ^^. Seems I can't even get my head around using a forum at the moment! There's probably no hope!!

phsieh2005 July 6, 2011 13:32

Thanks a lot Alynx!

Pei

PSYMN July 6, 2011 16:10

Insider answer...
 
Hey EphemeralMemory;

I spoke to some experts here and got this back...

Quote:

The only possible-and-significant differences that I can think of are in the "zones" sections. At one point in years long past, we changed how the boundary condition information is stored. We introduced a new section number for it. (All .msh and .cas file sections begin with "(# ", where # is the section ID.)

FLUENT can still read both types of sections, but GAMBIT may only write the original type. TGrid can probably read and write both types, so it can probably be used as a translator between the two.
I guess it may be worth updating your reader?

If you don't think this is the issue, can you share your example files...

juliuslein October 7, 2011 09:42

Setting user variable under Windows (7)
 
Hey all,

first of all thanks for your posts and the hint with the environment variable. If you are not willing and / or allowed to set this variable permanently you can write a tiny .bat-file that does exactly this for you. Just create a text file, rename it to "start.bat" and paste in the following (please adapt your working directory):

set AWP_WRITE_FLUENT_MESH_ASCII=1
"C:\Program Files\ANSYS Inc\v121\Framework\bin\Win64\runwb2.exe"

Good luck

WaterDynamics February 7, 2012 04:37

Thanks it works

alberto February 12, 2012 21:10

Any experience with ANSYS Mesh Version 14? It does not seem to take this environment variable into account, and keeps exporting a binary .msh file (FLUENT format).

Thanks in advance.

Best,

phsieh2005 February 13, 2012 11:16

Hi, Alberto,

In Meshing, click "Tools", select "Options", then, click Export. You should see ANSYS Fluent. Next to "Format of input files (*.msh)", select ASCII (this is a pull down menu).

Have fun!

Pei-Ying

WaterDynamics February 14, 2012 03:06

It work for me when I use Ansys 12.1 but not for Ansys 14.0, Any Clue why:confused:




Quote:

Originally Posted by JasonG (Post 295748)
Pei,

Here are some quick steps I followed to setup my computer, hopefully this will assist you:

Step 1: Right click on "My Computer" icon from desktop, click on "Properties", click on the "Advanced" tab, and then click on "Environment Variabls".

Step 2: Under "User Variables for __" click "New", a box should pop up. Fill out the following:

Variable name: AWP_WRITE_FLUENT_MESH_ASCII
Variable value: 1

Step 3: Click "ok" on all the windows to close out of the system properties.

Step 4: Once in the meshing applet of workbench, go to "File" -> "Export", and then select the ".msh" option.

This should export the fluent file in the correct format, and should translate all components (as long as none are overlapping).


WaterDynamics February 14, 2012 03:15

Quote:

Originally Posted by phsieh2005 (Post 344158)
Hi, Alberto,

In Meshing, click "Tools", select "Options", then, click Export. You should see ANSYS Fluent. Next to "Format of input files (*.msh)", select ASCII (this is a pull down menu).

Have fun!

Pei-Ying

Thanks Pei- Ying

Amol

PSYMN February 14, 2012 09:28

Right, now that it is an option, the environment variable is not needed.

juaneco2710 March 16, 2013 01:52

use the GUI
 
In the Meshing module of Workbench, go to:

Tools -> Options -> Meshing -> Export

set the export format to ASCII. That's it! This worked for me for ANSYS 14.0 on Windows 8.

archeoptyrx May 3, 2013 16:06

Hey JAson ,

I followed the steps as you said . But when i tried to convert the mesh file which is generated after all these steps . (in ASCII format) in linux using fluentMeshToFoam fluent.msh .. its showing errors .

Help me out guys :(

Quote:

Originally Posted by JasonG (Post 295748)
Pei,

Here are some quick steps I followed to setup my computer, hopefully this will assist you:

Step 1: Right click on "My Computer" icon from desktop, click on "Properties", click on the "Advanced" tab, and then click on "Environment Variabls".

Step 2: Under "User Variables for __" click "New", a box should pop up. Fill out the following:

Variable name: AWP_WRITE_FLUENT_MESH_ASCII
Variable value: 1

Step 3: Click "ok" on all the windows to close out of the system properties.

Step 4: Once in the meshing applet of workbench, go to "File" -> "Export", and then select the ".msh" option.

This should export the fluent file in the correct format, and should translate all components (as long as none are overlapping).


phsieh2005 May 3, 2013 16:58

Hi,

First try opening the mesh file to check if it is in ASCII format.

If yes, try fluent3DMeshToFoam to convert to openFoam format.

Pei-Ying

archeoptyrx May 3, 2013 17:39

This is for a 3D mesh right ? . Mine is a 2D mesh . so using fluentMeshToFoam flat.msh would help ? ???? . I am new to OpenFoam . Correct me if i was wrong .

phsieh2005 May 3, 2013 21:30

Hi,

Sorry that I never tried converting a 2D mesh into openFoam. However, openFoam only deals with 3D mesh. So, you might want to extrude your 2D mesh to 3D with 1 cell thick, then, try the conversion again.

Good luck!

Peiying


All times are GMT -4. The time now is 17:28.