CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ...

Problems converting a Fluent case file

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

Like Tree2Likes
  • 1 Post By Lieven
  • 1 Post By McFly

Reply
 
LinkBack Thread Tools Display Modes
Old   May 19, 2013, 03:37
Default Problems converting a Fluent case file
  #1
New Member
 
Martin Goddard
Join Date: Mar 2013
Location: Melbourne, AU
Posts: 22
Rep Power: 4
McFly is on a distinguished road
Hello,

I have been trying to convert a Fluent .cas file (saved in ASCII) for use in OpenFOAM 2.1.1. The mesh has been adapted in Fluent and has hanging nodes, so there is no mesh file. I'm not sure if this is the problem.

The first error message when converting the case file is usually something like:
Code:
--> FOAM FATAL ERROR:
Do not understand characters: |
    on line 4337

    From function fluentMeshToFoam::lexer
    in file fluent3DMeshToFoam.L at line 748.

FOAM exiting
So the file was edited with a text editor (EditPadLite7, as the ASCII file is 1GB size) to remove the offending characters (the | symbol). This could be done as these were not part of the mesh data. The conversion process then gets a bit further until this error:
Code:
--> FOAM FATAL ERROR:
15 not found in table.  Valid entries:
13
(
1
2
3
4
5
6
7
8
9
10
11
12
14
)
Looking at the case file there are 14 zones specified. I can add at 15th, such as is done in this thread. This means finding the area in the .cas file:
Code:
(39 (14 interior default-interior 1)(
 (is-not-a-rans-les-interface . #t)
))
And adding another zone:
Code:
(39 (14 interior default-interior 1)(
 (is-not-a-rans-les-interface . #t)
))
(39 (15 interior bananas 1)(
 (is-not-a-rans-les-interface . #t)
))
With this modification fluent3DMeshToFoam runs, and completes without further errors. However, running checkMesh on this case fails with a bunch of errors that look like this:
Code:
Checking topology...
    Boundary definition OK.
--> FOAM Serious Error : 
    From function bool zone::checkDefinition(const label maxSize, const bool report) const
    in file meshes/polyMesh/zones/zone/zone.C at line 211
    Zone bananas contains invalid index label 1009794

... <SNIP> ...

--> FOAM FATAL ERROR:
Too many errors
If, instead of adding zones in the .cas file, one merely changes the last zone to 15:
Code:
(39 (15 interior default-interior 1)(
 (is-not-a-rans-les-interface . #t)
))
then errors such as this occur:
Code:
Zipping mesh to remove hanging nodes
--> FOAM Warning : 
    From function void polyMeshZipUpCells(polyMesh& mesh)
    in file polyMeshZipUpCells/polyMeshZipUpCells.C at line 697
    Duplicate point found in the new face. 
Point: 39132 face: 8(31989 31543 31542 34169 31542 51478 39132 51483)
Does anyone have any thoughts as to why this cannot be converted? Is it just the hanging node issue?
McFly is offline   Reply With Quote

Old   May 19, 2013, 10:11
Default A work-around
  #2
New Member
 
Martin Goddard
Join Date: Mar 2013
Location: Melbourne, AU
Posts: 22
Rep Power: 4
McFly is on a distinguished road
Hello again,

I'm still not sure why the error occurs however this work-around appears to have fixed it.

Going with the extra zone (bananas) from above:
Code:
(39 (15 interior bananas 1)(
 (is-not-a-rans-les-interface . #t)
))
fluent3DMeshToFoam produces corresponding zone:
Code:
Creating cellZone 0 name: fluid type: fluid
Creating cellZone 1 name: bananas type: interior
This extra cellZone causes a bunch of problems. However, it can be found within the <case>/control/polyMesh/cellZones file. The top of the file looks like this:
Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

2            //There are two zones in this file (my comment)
(
fluid
{
    type cellZone;
cellLabels      List<label> 
4496302
(
0
1
2
...
Indicating two zones. Change the 2 to a 1.

Then, further down the file, I find my new zone:

Code:
bananas
{
    type cellZone;
cellLabels      List<label> 
615228
(
4496302
4496303
4496304
...
5111529
5111530
)
;
}
... and all the data for this zone is deleted.

Now checkMesh gives an "OK" result - which is a sight for sore eyes after spending many, many hours trying to get around this issue.

This mesh has been run in a simulation with icoFoam without issues, so I think it's okay. The next test will be trying the same work-around out on the larger mesh with double adaption and seeing if the same process works.

I'm still curious why fluent3DMeshToFoam needs an extra zone to run. If I get time I will have a look through the source code to try and understand what I'm doing wrong.

Any thoughts on this would be appreciated.
McFly is offline   Reply With Quote

Old   May 19, 2013, 13:43
Default
  #3
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,253
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Martin,

I only managed to give a quick read to your posts. I think you can find part of the answer here: Problem with fluentDataToFoam (from OF 1.6 ex) in OF 2.1.1 - post #4

I think the missing part of the answer is due to Fluent's format: it uses fixed codes for each field and mesh type. This would explain why it required you to add the 15th code.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   May 30, 2013, 08:10
Default
  #4
New Member
 
Nisha
Join Date: Sep 2009
Location: Massachusetts
Posts: 18
Rep Power: 7
nisha is on a distinguished road
Could you please tell how to save Fluent .cas files in ASCII format ?
nisha is offline   Reply With Quote

Old   May 30, 2013, 21:29
Default
  #5
New Member
 
Martin Goddard
Join Date: Mar 2013
Location: Melbourne, AU
Posts: 22
Rep Power: 4
McFly is on a distinguished road
It probably depends on the version of fluent.

In v14.5 it's simple:

File menu > Write > Case ... then in the Select File dialogue box uncheck the box labelled Write Binary Files.

The file saved will be in ASCII format and about twice the size of the binary file.

When you open a binary file something like this will appear in the log:

Code:
248908 hexahedral cells, zone  1, binary.
When it's an ASCII file the 'binary' tag will disappear.

For other versions of Fluent and for queries off the topic of this thread (converting case files) you'd be better served searching the forums or starting a new thread.
McFly is offline   Reply With Quote

Old   May 31, 2013, 01:33
Default
  #6
New Member
 
Nisha
Join Date: Sep 2009
Location: Massachusetts
Posts: 18
Rep Power: 7
nisha is on a distinguished road
McFly,

Thanks, it worked. I'm using Fluent v13. As you pointed out, the file size is much higher in ASCII format.
nisha is offline   Reply With Quote

Old   July 31, 2013, 09:28
Default
  #7
New Member
 
Martin Goddard
Join Date: Mar 2013
Location: Melbourne, AU
Posts: 22
Rep Power: 4
McFly is on a distinguished road
Just to follow up on my above post.

Firstly, thank you Bruno for your response - I haven't had time to look into it further yet, but maybe someone else will when they have the same problem.

Secondly, two weeks ago I tried the same work-around with a mesh of almost 7M cells and it seems to have worked without issues (the mesh was then decomposed and ran on 256 processors fine) so this is a viable solution for now.

Thanks,


McFly
McFly is offline   Reply With Quote

Old   July 31, 2013, 09:59
Default
  #8
Member
 
Join Date: Jul 2013
Posts: 42
Rep Power: 4
HHOS is on a distinguished road
Hello!

Just one question that might be stupid, but I am completely new with OpenFOAM... When you transform the mesh using a .cas file instead of a .msh file, you get the whole case set up into OpenFoam? or just the mesh, as if it was a simple .msh file?

I ask this, because what I now do is to import the .msh file and then set up the case with HelyxOS, so I don't need to go through so many code files.

Thank you
HHOS is offline   Reply With Quote

Old   July 31, 2013, 10:23
Default
  #9
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Mol, Belgium
Posts: 295
Rep Power: 13
Lieven will become famous soon enough
OpenFoam is not capable of interpreting fluent case setups. So if you manage to load the .cas-file, I guess you will only have the mesh (but I have to admit, I wouldn't know how you would convert the .cas-file in openfoam).

Cheers,

L
HHOS likes this.
Lieven is offline   Reply With Quote

Old   July 31, 2013, 10:38
Default
  #10
Member
 
Join Date: Jul 2013
Posts: 42
Rep Power: 4
HHOS is on a distinguished road
OK, then... So the good way to do things is to transform just the .msh file...

I get no problems with that...
HHOS is offline   Reply With Quote

Old   August 1, 2013, 21:41
Default
  #11
New Member
 
Martin Goddard
Join Date: Mar 2013
Location: Melbourne, AU
Posts: 22
Rep Power: 4
McFly is on a distinguished road
Hello,

As Lieven said, you are only converting the mesh information.

The software can extract a mesh from a case file. This is useful in certain circumstances, such as my case given above.

Regards,


McFly
HHOS likes this.
McFly is offline   Reply With Quote

Reply

Tags
case, convert, error, fluent

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
swak4Foam-groovyBC build problem zxj160 OpenFOAM 18 July 30, 2013 13:14
funkySetFields compilation error tayo OpenFOAM 39 December 3, 2012 06:18
mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 12 December 12, 2011 05:16
Problem installing on Ubuntu 9.10 -> 'Cannot open : No such file or directory' mfiandor OpenFOAM Installation 2 January 25, 2010 10:50
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 12:24


All times are GMT -4. The time now is 02:10.