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)

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 12:46.