CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Problem with fluentDataToFoam (from OF 1.6 ex) in OF 2.1.1 (https://www.cfd-online.com/Forums/openfoam-pre-processing/114387-problem-fluentdatatofoam-1-6-ex-2-1-1-a.html)

DDB March 10, 2013 07:35

Problem with fluentDataToFoam (from OF 1.6 ex) in OF 2.1.1
 
Hi all,

I followed the instructions in this thread to overcome the compilation problems
http://www.cfd-online.com/Forums/ope...of2-1-1-a.html

I have already generated the OF mesh using fluent3DMeshToFoam. However, when I run fluentDataToFoam I get the error:

Code:

--> FOAM FATAL IO ERROR:
cannot find file

file: /home/.../constant/polyMesh/zoneToPatchName at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 73.

FOAM exiting

There is no file called zoneToPatchName in my polyMesh folder. Is this due to a change in fluent3DMeshToFoam since v1.6 or is it a problem with fluentDataToFoam?

Any help gratefully received!

wyldckat March 10, 2013 07:39

Hi DDB,

Can you create a simple test case and share it so that I (or anyone else) can try to replicate the same error!?

Best regards,
Bruno

DDB March 10, 2013 09:02

I'd love to, but I don't have access to fluent anymore :-(

I did some cases at uni a few years ago & now I want to work on them in OF, but I am not at uni now and I certainly cannot afford the fluent fees!

wyldckat March 10, 2013 10:42

Hi DDB,

Very well, then lets reverse engineer this thing.

First I'm going to use the tutorial "incompressible/icoFoam/cavity" as basis for creating the simple Fluent dataset:
  1. Run the tutorial:
    Code:

    blockMesh
    icoFoam

  2. Then extract the components for U:
    Code:

    foamCalc components U
Now to convert the mesh and data to Fluent format:
  1. Create the file "system/foamDataToFluentDict" with the following contents:
    Code:

    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                |                                                |
    | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
    |  \\    /  O peration    | Version:  2.1.x                                |
    |  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
    |    \\/    M anipulation  |                                                |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
        version    2.0;
        format      ascii;
        class      dictionary;
        location    "system";
        object      foamDataToFluentDict;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    p 1;

    Ux 111;
    Uy 112;
    Uz 113;

    I know the codes, because I looked at the fluentDataToFoam source code, more specifically inside the file "fluentDataToFoam.L".
  2. Converted the OpenFOAM mesh and data to Fluent format:
    Code:

    foamMeshToFluent
    foamDataToFluent



Now for converting stuff back from Fluent to OpenFOAM:
  1. Convert the mesh by running:
    Code:

    fluentMeshToFoam fluentInterface/cavity.msh
    This is only because this is the simple cavity. fluent3DMeshToFoam should be used for more complicated cases.
  2. Then look into the file "fluentInterface/cavity.msh" and find the codes for each patch. At the end of the file you should find this:
    Code:

    (39 (1 fluid fluid-1)())
    (39 (2 interior interior-1)())
    (39 (10 wall movingWall)())
    (39 (11 wall fixedWalls)())
    (39 (12 pressure-outlet frontAndBack)())

    This is what we'll use as reference for the "zoneToPatchName" file.
  3. Create the file "constant/polyMesh/zoneToPatchName" with the following contents:
    Code:

    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                |                                                |
    | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
    |  \\    /  O peration    | Version:  2.1.x                                |
    |  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
    |    \\/    M anipulation  |                                                |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
        version    2.0;
        format      ascii;
        class      wordList;
        location    "constant/polyMesh";
        object      zoneToPatchName;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    /*
    (39 (1 fluid fluid-1)())
    (39 (2 interior interior-1)())
    (39 (10 wall movingWall)())
    (39 (11 wall fixedWalls)())
    (39 (12 pressure-outlet frontAndBack)())
    */

    13
    (
      dummy    //foam 0 - no fluent correspondence
      unknown  //foam 1 - fluent 1
      interior //foam 2 - fluent 2
      dummy    //foam 3 - fluent 3
      dummy    //foam 4 - fluent 4
      dummy    //foam 5 - fluent 5
      dummy    //foam 6 - fluent 6
      dummy    //foam 7 - fluent 7
      dummy    //foam 8 - fluent 8
      dummy    //foam 9 - fluent 9
      movingWall    //foam 10 - fluent 10
      fixedWalls    //foam 11 - fluent 11
      frontAndBack  //foam 12 - fluent 12
    );

    Notice the details:
    • The commented block that has the files from the "cavity.msh" file are only there for reference for creating the array of names.
    • "unknown" is the default name given for the internal field, as defined in fluentDataToFoam's source code.
    • Keep in mind that the full array of names has to be given, with dummy names for the patches that don't have a name assigned on OpenFOAM's side of things.
    • Said array starts at 0 (zero), which is why there is the extract line at the top of the array.
  4. Then you can run the converter for the desired time instance:
    1. Edit the file "system/controlDict" and adjust the "startTime" entry accordingly. For example, I want to convert the time instance "0.1":
      Code:

      startTime      0.1;
    2. The convert:
      Code:

      fluentDataToFoam fluentInterface/cavity0.1.dat


A few notes of caution:
  • This conversion method does not take into account all of the possible boundary conditions! For example, the original boundary condition for "U" had the following "boundaryField":
    Code:

    boundaryField
    {
        movingWall
        {
            type            fixedValue;
            value          uniform (1 0 0);
        }
        fixedWalls
        {
            type            fixedValue;
            value          uniform (0 0 0);
        }
        frontAndBack
        {
            type            empty;
        }
    }

    The converted form resulted in:
    Code:

    boundaryField
    {
        movingWall
        {
            type            calculated;
            value          uniform (1 0 0);
        }
        fixedWalls
        {
            type            calculated;
            value          uniform (0 0 0);
        }
        frontAndBack
        {
            type            empty;
        }
    }

    This means that you have to edit the field files after conversion and correct appropriately.
  • Convertible fields can be found the source code file "fluentDataToFoam.L", in the "main" function. If you feel lost in the file, search for "momentum".
Best regards,
Bruno

DDB March 10, 2013 13:42

Bruno, you are an OF guru! Thank you so much!

I had no issues at all with the cavity problem, following the steps as you outlined, however I ran into some issues with my old fluent files.

The msh file is easier to find info for the zoneToPatchName than the cas file, but searching for "(39 (" found the stuff ok.

(For my reference when I come back to this, change the number in the zoneToPatchName to correspond to the number of patches! 13 is not unique!)

I have changed the startTime in system/controlDict, but the data only writes to the 0 folder (whereas following your example there was no issue in writing to whatever folder I chose).

I haven't had a chance to look at the boundary conditions yet, but your help so far has been amazing, thank you :-)

hz283 March 21, 2013 05:20

Hello Bruno,

Your procedures listed are veru useful. I did the fluentDataToFoam but the following error:

Create time

Machine config: 600012484888
Grid size: nCells = 5984008 nFaces = 12248025 nPoints = 1156110
00Grid size: nCells = 1 nFaces = 25 nPoints = 1


--> FOAM FATAL IO ERROR:
wrong token type - expected int, found on line 1 the punctuation token '('

file: IStringStream.sourceFile at line 1.

From function operator>>(Istream&, int&)
in file primitives/ints/int/intIO.C at line 68.


FOAM exiting

Does it mean the format of the dat files are not correct?


Quote:

Originally Posted by wyldckat (Post 412947)
Hi DDB,

Very well, then lets reverse engineer this thing.

First I'm going to use the tutorial "incompressible/icoFoam/cavity" as basis for creating the simple Fluent dataset:
  1. Run the tutorial:
    Code:

    blockMesh
    icoFoam

  2. Then extract the components for U:
    Code:

    foamCalc components U
Now to convert the mesh and data to Fluent format:
  1. Create the file "system/foamDataToFluentDict" with the following contents:
    Code:

    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                |                                                |
    | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
    |  \\    /  O peration    | Version:  2.1.x                                |
    |  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
    |    \\/    M anipulation  |                                                |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
        version    2.0;
        format      ascii;
        class      dictionary;
        location    "system";
        object      foamDataToFluentDict;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    p 1;

    Ux 111;
    Uy 112;
    Uz 113;

    I know the codes, because I looked at the fluentDataToFoam source code, more specifically inside the file "fluentDataToFoam.L".
  2. Converted the OpenFOAM mesh and data to Fluent format:
    Code:

    foamMeshToFluent
    foamDataToFluent



Now for converting stuff back from Fluent to OpenFOAM:
  1. Convert the mesh by running:
    Code:

    fluentMeshToFoam fluentInterface/cavity.msh
    This is only because this is the simple cavity. fluent3DMeshToFoam should be used for more complicated cases.
  2. Then look into the file "fluentInterface/cavity.msh" and find the codes for each patch. At the end of the file you should find this:
    Code:

    (39 (1 fluid fluid-1)())
    (39 (2 interior interior-1)())
    (39 (10 wall movingWall)())
    (39 (11 wall fixedWalls)())
    (39 (12 pressure-outlet frontAndBack)())

    This is what we'll use as reference for the "zoneToPatchName" file.
  3. Create the file "constant/polyMesh/zoneToPatchName" with the following contents:
    Code:

    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                |                                                |
    | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
    |  \\    /  O peration    | Version:  2.1.x                                |
    |  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
    |    \\/    M anipulation  |                                                |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
        version    2.0;
        format      ascii;
        class      wordList;
        location    "constant/polyMesh";
        object      zoneToPatchName;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    /*
    (39 (1 fluid fluid-1)())
    (39 (2 interior interior-1)())
    (39 (10 wall movingWall)())
    (39 (11 wall fixedWalls)())
    (39 (12 pressure-outlet frontAndBack)())
    */

    13
    (
      dummy    //foam 0 - no fluent correspondence
      unknown  //foam 1 - fluent 1
      interior //foam 2 - fluent 2
      dummy    //foam 3 - fluent 3
      dummy    //foam 4 - fluent 4
      dummy    //foam 5 - fluent 5
      dummy    //foam 6 - fluent 6
      dummy    //foam 7 - fluent 7
      dummy    //foam 8 - fluent 8
      dummy    //foam 9 - fluent 9
      movingWall    //foam 10 - fluent 10
      fixedWalls    //foam 11 - fluent 11
      frontAndBack  //foam 12 - fluent 12
    );

    Notice the details:
    • The commented block that has the files from the "cavity.msh" file are only there for reference for creating the array of names.
    • "unknown" is the default name given for the internal field, as defined in fluentDataToFoam's source code.
    • Keep in mind that the full array of names has to be given, with dummy names for the patches that don't have a name assigned on OpenFOAM's side of things.
    • Said array starts at 0 (zero), which is why there is the extract line at the top of the array.
  4. Then you can run the converter for the desired time instance:
    1. Edit the file "system/controlDict" and adjust the "startTime" entry accordingly. For example, I want to convert the time instance "0.1":
      Code:

      startTime      0.1;
    2. The convert:
      Code:

      fluentDataToFoam fluentInterface/cavity0.1.dat


A few notes of caution:
  • This conversion method does not take into account all of the possible boundary conditions! For example, the original boundary condition for "U" had the following "boundaryField":
    Code:

    boundaryField
    {
        movingWall
        {
            type            fixedValue;
            value          uniform (1 0 0);
        }
        fixedWalls
        {
            type            fixedValue;
            value          uniform (0 0 0);
        }
        frontAndBack
        {
            type            empty;
        }
    }

    The converted form resulted in:
    Code:

    boundaryField
    {
        movingWall
        {
            type            calculated;
            value          uniform (1 0 0);
        }
        fixedWalls
        {
            type            calculated;
            value          uniform (0 0 0);
        }
        frontAndBack
        {
            type            empty;
        }
    }

    This means that you have to edit the field files after conversion and correct appropriately.
  • Convertible fields can be found the source code file "fluentDataToFoam.L", in the "main" function. If you feel lost in the file, search for "momentum".
Best regards,
Bruno


wyldckat March 24, 2013 12:13

Hi hz283,

Follow my example with the tutorial case and then compare the file formats.
I say this because I can't figure out what's wrong just from your error message :( So you'll have to compare the files yourself! ;)

Best regards,
Bruno

hz283 March 24, 2013 13:15

Hi Bruno,

Thank you so much for your continuous help.

best H

Quote:

Originally Posted by wyldckat (Post 416034)
Hi hz283,

Follow my example with the tutorial case and then compare the file formats.
I say this because I can't figure out what's wrong just from your error message :( So you'll have to compare the files yourself! ;)

Best regards,
Bruno


Alhasan October 6, 2013 11:09

Hi Bruno,
From all this i just have one question for you I'm not that familiar with openFOAM so that being said
in the foamDatatoFluentDict

how do you know what value corresponds to what like u have entered
p 1;

Ux 111;
Uy 112;
Uz 113;

i want to know the values for objects such as k, alpha, p_mean, u_mean and all such objects and their corresponding number where is the dictionary with the list of values and i dunno where is "fluentDataToFoam.L" been searching all inside open foam

Best Regards,
Hasan K.J.

wyldckat October 6, 2013 11:16

Hi Hasan,

Good question! I was going to say that I didn't know, but then I did a quick search and found this: https://github.com/OpenFOAM/OpenFOAM...nitNumbers.txt

Best regards,
Bruno

Alhasan October 6, 2013 11:35

Hi Bruno,

Thanks for the reply, clearly i have to improve my searching skills coz i have been searching for quite some time now :p u saved me a lot of time.
So in the link u sent me it comes like
XF_RF_DATA_NULL=0,
XF_RF_DATA_NULL_M1=0,
XF_RF_DATA_NULL_M2=0,
XF_RF_DATA_NULL_MEAN=0,
XF_RF_DATA_NULL_RMS=0,
XF_RF_DATA_PRESSURE=1,

so the nomenclature we put doesnot matter only the number maters or we need to put the nomenclature that will be there on the "0" file ?

Thanks a lot for your time :)

Regards,
Hasan K.J

Alhasan October 14, 2013 15:30

Thanks for sharing... :) :) :)
 
Quote:

Originally Posted by wyldckat (Post 455315)
Hi Hasan,

Good question! I was going to say that I didn't know, but then I did a quick search and found this: https://github.com/OpenFOAM/OpenFOAM...nitNumbers.txt

Best regards,
Bruno

Hi Bruno,

That helped me a lot i have been playing with it for the past few days and i am not still able to figure which of the those numbers go for
pMean, PMean2Prime, UMean and UMean2Prime.

atleast for pMean and PMean2Prime i can guess XF_RF_DATA_PRESSURE_MEAN=400,
XF_RF_DATA_PRESSURE_RMS=401,

but for UMean and UMean2Prime (openFOAM has only one file) could it be
XF_RF_DATA_X_VELOCITY_MEAN=402,
XF_RF_DATA_X_VELOCITY_RMS=403,
XF_RF_DATA_Y_VELOCITY_MEAN=404,
XF_RF_DATA_Y_VELOCITY_RMS=405,
XF_RF_DATA_Z_VELOCITY_MEAN=406,
XF_RF_DATA_Z_VELOCITY_RMS=407,

i tired but no luck,
any wise suggestions :) :)

Kind Regards,
Hasan K.J

wyldckat October 14, 2013 16:33

Hi Hasan,

I don't have access to Fluent, therefore I have absolutely no idea :(
Given that Fluent uses such a coded way of distinguishing fields, my guess is that there are no such fields in Fluent.

My suggestion if that you run a simple example case in Fluent and try to generate those fields. Then save the case in ASCII format and then try to figure out where those fields are defined in the file and which code is used by Fluent.

Good luck! Best regards,
Bruno

Alhasan October 14, 2013 16:49

Hey Bruno,

Perfect :D i did that when i had some trouble importing data to CFDPost, but i dunno why it dint strike me now :)

Thanks a lot for the suggestion :)
Kind Regards,
Hasan K.J

salehi144 February 3, 2014 09:16

Dear Bruno,

First Thanks for your helps.
I did follow your example step by step and it works fine. But when i try to do my own case i get this

------------------------------------------------------------------------------------------------------
Machine config: 600012444888
Grid size: nCells = 1594250 nFaces = 4842786 nPoints = 1654892
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\00Grid size: nCells = 1 nFaces = 2 nPoints = 1
E�s���俟h

--> FOAM FATAL IO ERROR:
Attempt to get back from bad stream

file: IStringStream.sourceFile at line 0.

From function void Istream::getBack(token&)
in file db/IOstreams/IOstreams/Istream.C at line 56.

FOAM exiting
------------------------------------------------------------------------------------------------------

What do you think the problem is. Just so you know i am using Ansys Fluent 14.5. Does "fluentDataToFoam" support newer version of fluent files?

Thanks,
Cheers.

wyldckat February 4, 2014 14:35

Greetings Saeed,

Quote:

Originally Posted by salehi144 (Post 473128)
What do you think the problem is. Just so you know i am using Ansys Fluent 14.5. Does "fluentDataToFoam" support newer version of fluent files?

I've never used Fluent, so I have no idea.
But I believe that the problem is related to the export option you're using, namely that you cannot use the binary export mode, you must use the ASCII (text) mode.

Best regards,
Bruno

salehi144 February 10, 2014 07:30

Dear Bruno,

Thanks for your guidance. I'm gonna give it a try.

Best Regards,

isabel March 26, 2015 04:44

Dear everybody,

I type fluentDataToFoam name.dat and I also have the following error:

--> FOAM FATAL IO ERROR:
wrong token type - expected int, found on line 1 the punctuation token '('

file: IStringStream.sourceFile at line 1.

From function operator>>(Istream&, int&)
in file primitives/ints/int/intIO.C at line 68



Has anyone solved it?

wyldckat March 28, 2015 15:50

Greetings Isabel,

After re-reading most of the posts above, I have to ask you this: is your Fluent data file in ASCII or in binary format?
Because fluentDataToFoam can only handle ASCII format.

Best regards,
Bruno

isabel April 9, 2015 07:54

Dear Bruno,

Thank you very much. I have disabled the option "write binary files" when I write the Fluent data and now I can execute fluentMeshToFoam and fluentDataToFoam.
Nevertheless, when I open the results in ParaView these are different from the original Fluent ones. I am working with a 3D simulation. Does anybody know what happens?

wyldckat April 9, 2015 16:16

Hi Isabel,

If you had provided images of what you're seeing, I would have been able to accurately diagnose the issue. ;)

Since you didn't, I'll have to guess :rolleyes::
  1. You're not looking at the same data type in ParaView, as the one you're seeing in Fluent.
  2. Or you want to see the surface of the mesh, and instead you're seeing the internal mesh.
Best regards,
Bruno

isabel April 10, 2015 03:16

Excuse me I did not provide images.

This is the pressure field that I have in the original Fluent files:
http://fotos.miarroba.es/lamasgaldo/...2755277B35.jpg
http://fotos.miarroba.es/th/1a8c/305...2B55277B27.jpg


And this is the pressure field that I read in OpenFOAM after fluentDataToFoam conversion:

http://fotos.miarroba.es/th/da14/355...2755277B35.jpg


The internal pressure is Ok, but the pressure at boundary conditions is not the same in OpenFOAM and Fluent

This is my zoneToPatchName file:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class wordList;
location "constant/polyMesh";
object zoneToPatchName;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

/*
(45 (2 fluid fluid)())
(45 (3 wall wall)())
(45 (4 wall symmetry)())
(45 (5 wall outlet)())
(45 (6 wall inlet)())
(45 (8 interior default-interior)())
*/

9
(
dummy //foam 0 - no fluent correspondence
dummy //foam 1 - fluent 1
fluid //foam 2 - fluent 2
wall //foam 3 - fluent 3
symmetry //foam 4 - fluent 4
outlet //foam 5 - fluent 5
inlet //foam 6 - fluent 6
dummy //foam 7 - fluent 7
default-interior //foam 8 - fluent 8
);




After fluentDataToFoam conversion, the content of zoneToPatchName file changes to this:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.0 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class wordList;
location "constant/polyMesh";
object zoneToPatchName;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


9
(
unknown
unknown
unknown
wall
symmetry
outlet
inlet
unknown
default-interior
)


// ************************************************** *********************** //

wyldckat April 12, 2015 15:56

Hi Isabel,

I don't have much experience with converting Fluent data to OpenFOAM data, therefore I'm not familiar with any usual issues that can occur in these cases.

Nonetheless, try using foamToVTK like this:
Code:

foamToVTK -noPointValues
to export the data into VTK files. Then open the respective VTK files in ParaView, without point data. If my guess is correct, the problem has to do with how you're looking at the values.

Beyond that, I suggest you try a simpler test case. If the simpler test case has the same problems, please share the complete test case, so that I or anyone else can look into this.

Best regards,
Bruno

isabel April 16, 2015 02:55

Thank you very much. Now it works.

vasava October 25, 2016 03:43

Problem with fluentDataToFoam (from OF 1.6 ex) in OF 2.3.1
 
Has anyone tried to compile and use fluentDataToFoam with openFoam 2.3.1?

I managed to compile fluentDataToFoam but no luck with any mapping yet. I have case and data files made with Fluent V17.2.

I keep getting the long list of corrupted double-link list.
Code:

*** glibc detected *** fluentDataToFoam: corrupted double-linked list: 0x00000000010f43a0 ***
I am following instruction given by Bruno Santos.

Any clues or suggestions?

lukasf February 26, 2021 08:55

Caution for Fluent cases in which only the mesh was replaced
 
Great explanation Bruno.



However, note that this does not work if you load the .msh file into an existing Fluent .cas file. What happens is then that the Zone Section ID's in the .cas and .msh do not (have to) match.



For the .dat file the ID's of the .cas are the important ID's for the zoneToPatchName file.

lukasf June 27, 2022 11:24

Have you found a solution?


For me it works to create a .dat file with the averaged / mean fields using:

Code:

UMeanx 402;
UMeany 404;
UMeanz 406;
TMean 408;


The values of these scalars are correctly written to the .dat file but when I load the .dat file into fluent the values are wrong (the trend looks correct but the absolute values are way off).


Any suggestions?


Quote:

Originally Posted by Alhasan (Post 456915)
Hi Bruno,

That helped me a lot i have been playing with it for the past few days and i am not still able to figure which of the those numbers go for
pMean, PMean2Prime, UMean and UMean2Prime.

atleast for pMean and PMean2Prime i can guess XF_RF_DATA_PRESSURE_MEAN=400,
XF_RF_DATA_PRESSURE_RMS=401,

but for UMean and UMean2Prime (openFOAM has only one file) could it be
XF_RF_DATA_X_VELOCITY_MEAN=402,
XF_RF_DATA_X_VELOCITY_RMS=403,
XF_RF_DATA_Y_VELOCITY_MEAN=404,
XF_RF_DATA_Y_VELOCITY_RMS=405,
XF_RF_DATA_Z_VELOCITY_MEAN=406,
XF_RF_DATA_Z_VELOCITY_RMS=407,

i tired but no luck,
any wise suggestions :) :)

Kind Regards,
Hasan K.J


lukasf October 24, 2022 12:12

Here is a summary on how to use foamDataToFluent:

1. In more recent Ansys Fluent versions you need to change the data format from dat.h5 to .dat. Go to preferences/general and choose legacy as the Default Format for I/O.
In the Console (Text user inferface) type:
/file/binary-legacy-files?
no

Now you can export the .dat file by going to file/write/Data.


2. In your Fluent case go to boundary conditions:
click onto each patch to see the ID numbers. Afterwards prepare a list for the file zoneToPatchName with the corresponding ID numbers and patchnames.


Moreover, look at the cell zone conditions and also add the e.g. fluid id which is the "unknown" patchname in zoneToPatchName.


constant/polymesh/zoneToPatchName:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.x                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      wordList;
    location    "constant/polyMesh";
    object      zoneToPatchName;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

39
(
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
dummy
unknown
int_fluid
RIGHT_SIDE1
TOP1
INLET1
LEFT_SIDE1
OUTLET1
WALL_PIPE1
RIGHT_SIDE_PRESSURE_TANK1
LEFT_SIDE_PRESSURE_TANK1
PRESSURE_TANK_INLET1
PRESSURE_TANK_WALL1
PRESSURE_TANK_WALL_SLIP1
BOTTOM_WALL_DOWNSTREAM1
BOTTOM_WALL1
 );

3. The file system/foamDataToFluentDict is not needed here. It is needed for foamDataToFluent and not for fluentDataToFoam



4. Download the file (foamDataToFluent) and compile it.
Copy zoneToPatchName to constant/polyMesh/.


Set in the system/controlDict the startTime which equals the directory to which the data is converted to.


Then run the command: foamDataToFluent YourFluentDataName.dat


All times are GMT -4. The time now is 00:21.