CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS

How to import a data file (excel,txt or csv)to Fluent or CFD-Post?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By t.teschner
  • 1 Post By vinerm

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 5, 2015, 10:14
Default How to import a data file (excel,txt or csv)to Fluent or CFD-Post?
  #1
New Member
 
Join Date: May 2013
Posts: 21
Rep Power: 12
silvai is on a distinguished road
Hi!

My objective is to import to Fluent or CFD-post a data file done in Excel.

This Excel file have the "nodenumber", "x-coordinate", "y-coordinate", "new_parameter". This "new_parameter" was determined in Excel. So, I already have an Excel file, also a txt file (already converted) and csv file (already converted) like this:

nomenumber, x-coordinate, y-coordinate, z-coordinate, new_parameter
1,-0.00000123736464,-0.0017365363,0,0.763536373
2,0.00003425625,-0.0019373763,0,0.77660838383
3,-0.00006835662,-0.00736363,0,0.7798373732

I already tried to import the excel or txt or csv file to fluent or CFD-post (through several ways) but I canīt get.

After importing to Fuent or CFD-Post, my final objective is to obtain this "new parameter" drawn in 3D dimension of the geometry.


Do anyone know a simple way to import this file (excel, txt or csv) to fluent or CFD-Post?

I am wainting for an answer.
Thank you very much!
silvai is offline   Reply With Quote

Old   January 5, 2015, 18:58
Default
  #2
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 204
Rep Power: 16
t.teschner is on a distinguished road
as far as my fluent knowledge goes, you can't just import csv data into fluent for visualisation. one option i can think of is to convert the excel file into a file that is readable by fluent, like cgns, which also offers the advantage that you can store flow solutions like this "new_parameter".

that is rather tricky and a long shot, but since you are using excel, i assume you are getting data out of fluent, do some post processing in excel and then you want to read the post processed values back into fluent / cfd-post, right? both fluent and cfd-post have their inbuild calculators so whatever you are doing in excel may be accomplished within fluent / cfd-post without the need to export and reimport data to/from a csv file.

can you elaborate on what you want to do exactly in this csv file (what is "new_parameter")?
chaitanyaarige likes this.
t.teschner is offline   Reply With Quote

Old   January 5, 2015, 23:52
Default
  #3
Senior Member
 
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25
mprinkey will become famous soon enough
If you have a base Fluent case already with the geometry, you can use a UDF to read in the data from the file (in any format that you care to parse) and put it into User-Defined Memory. You have "nodenumber" as a value. If the node information was pulled from the Fluent case/geometry in order, you can just write directly to the node storage using the N_UDMI macro.

If the nodes are not in the same order as the Fluent base case, your UDF is going to have to sort and search to get the node data copied into the right place. In any case, I doubt that there is anything in the excel spreadsheet that could not just be coded directly into the UDF and then compute the data in place, rather than dumping to files and parsing back and forth.

If however you don't have a base Fluent case/geometry and your intention is to just pull the x,y,z + data values into a CFD code in order to visualize them, you are wasting your time. A list of node location and function values represents only a point cloud--there is no connectivity/geometry and Fluent/CFX is not going to be able to make sense of it. Take a look at Paraview. I think they have some plugins to display pointcloud data. Or maybe here:

http://pointclouds.org/documentation...ualization.php
mprinkey is offline   Reply With Quote

Old   January 7, 2015, 10:54
Default
  #4
New Member
 
Join Date: May 2013
Posts: 21
Rep Power: 12
silvai is on a distinguished road
Thank you for everyone. I already found this problem.

However, consequently, I have another....
Do anyone know, how can I export from Fluent the matrix with the links between the nodes of the mesh?

Like this (for exemple):

[Faces]0, 1, 23, 4, 56, 7, 89, 10, 11(...)

Thanks in advance.
silvai is offline   Reply With Quote

Old   January 7, 2015, 10:56
Default
  #5
New Member
 
Join Date: May 2013
Posts: 21
Rep Power: 12
silvai is on a distinguished road
I mean, like this:

[Faces]

0, 1, 2

3, 4, 5

6, 7, 8

9, 10, 11

(...)

Thanks in advance.
silvai is offline   Reply With Quote

Old   October 28, 2015, 03:36
Default
  #6
New Member
 
jyothsna k
Join Date: May 2014
Posts: 18
Rep Power: 11
jyothsna k is on a distinguished road
[QUOTE=mprinkey;526238]If you have a base Fluent case already with the geometry, you can use a UDF to read in the data from the file (in any format that you care to parse) and put it into User-Defined Memory.

can you please specify how this can be done.
jyothsna k is offline   Reply With Quote

Old   February 17, 2017, 14:51
Default
  #7
New Member
 
Filipa
Join Date: Feb 2017
Posts: 1
Rep Power: 0
FilipaC is on a distinguished road
Hi. I have exactly the same problem as you (the first problem). What you do for solve this? Thanks
FilipaC is offline   Reply With Quote

Old   March 27, 2017, 07:06
Default
  #8
New Member
 
Join Date: May 2013
Posts: 21
Rep Power: 12
silvai is on a distinguished road
Quote:
Originally Posted by FilipaC View Post
Hi. I have exactly the same problem as you (the first problem). What you do for solve this? Thanks
Hi!

Did you solve the problem yet?
silvai is offline   Reply With Quote

Old   May 17, 2017, 08:53
Default N_UDMI/structure reference not implemented
  #9
New Member
 
Join Date: Sep 2010
Location: Wuhan, China
Posts: 23
Rep Power: 15
qin chunqiu is on a distinguished road
I interpreted the following UDF, and allocated node memery, but Fluent reports an error: 'line 18: structure refrence not implemented'. I dont know why, so i am really grateful if anyone could tell me how to deal with this.
#include "udf.h"
DEFINE_ON_DEMAND(IG)
{
real x,y;
int n;
Domain *d;
Thread *t;
Node *v;
cell_t c;
d=Get_Domain(1);
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
c_node_loop (c,t,n) /*n is the local index number*/
{
v = C_NODE(c,t,n) ;/*to obtain the global cell node number*/
N_UDMI(v,0) =NODE_X(v);;
}
}
end_c_loop(c,t)
}
}
qin chunqiu is offline   Reply With Quote

Old   May 17, 2017, 10:02
Default
  #10
New Member
 
Join Date: Sep 2010
Location: Wuhan, China
Posts: 23
Rep Power: 15
qin chunqiu is on a distinguished road
the N_UDMI macro should be compiled rather than interpreted
qin chunqiu is offline   Reply With Quote

Old   June 20, 2017, 07:58
Default
  #11
New Member
 
lj
Join Date: Oct 2013
Posts: 1
Rep Power: 0
bmexlj is on a distinguished road
Quote:
Originally Posted by silvai View Post
Hi!

Did you solve the problem yet?
Hi, i am also wondering if this problem is solved.
bmexlj is offline   Reply With Quote

Old   January 12, 2018, 14:51
Default
  #12
New Member
 
Ahmed Hassan
Join Date: Nov 2017
Posts: 10
Rep Power: 8
Ahmed Hassan is on a distinguished road
How did you solve the first problem ?
Ahmed Hassan is offline   Reply With Quote

Old   September 5, 2018, 01:37
Default
  #13
Member
 
Leonardo
Join Date: Nov 2017
Posts: 37
Rep Power: 8
Leonardo.flores is on a distinguished road
I have the same problem... how did you solve it?
Leonardo.flores is offline   Reply With Quote

Old   January 27, 2020, 23:56
Default
  #14
New Member
 
Rupali
Join Date: Oct 2019
Posts: 14
Rep Power: 6
Rupali is on a distinguished road
I had inserted a udf of velocity profile consisting of different values of velocity at different time steps in the .txt format. The magnitude of velocity as in my tabulated data is both negative and positive. So, the problem I am facing is that fluent is only reading the positive values of velocities and neglecting the negative values of velocities. Because of which the velocity profile is not exactly what I want to implement. Can anyone suggest a proper solution to my problem?
Rupali is offline   Reply With Quote

Old   January 28, 2020, 17:51
Default
  #15
Senior Member
 
Svetlana Tkachenko
Join Date: Oct 2013
Location: Australia, Sydney
Posts: 407
Rep Power: 14
Светлана is on a distinguished road
Maybe you need two or three different velocity profiles. One for U, one for V, one for W. Then it can be negative
Светлана is offline   Reply With Quote

Old   January 28, 2020, 23:44
Default
  #16
New Member
 
Rupali
Join Date: Oct 2019
Posts: 14
Rep Power: 6
Rupali is on a distinguished road
I have attached the velocity profile graph. For this particular velocity profile I have written a UDF in tabulated form. I have data for time and velocity respectively. So, I am not able to understand how to construct two or three velocity profile from the tabulated data which I have? Please help me with this.
Rupali is offline   Reply With Quote

Old   January 31, 2020, 04:52
Default UDF not required
  #17
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
Hi Rupali

Since the velocity is a function of time alone, you may use a transient profile instead of a UDF. As far as direction is concerned, you already know it. Currently, with the UDF, you already have a direction specification given at the boundary, default is Normal to Boundary. If it is default and the boundary is planar, then you know the direction.
Rupali likes this.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
wmake compiling new solver mksca OpenFOAM Programming & Development 14 June 22, 2018 06:29
[swak4Foam] Swak4FOAM 0.2.3 / OF2.2.x installation error FerdiFuchs OpenFOAM Community Contributions 27 April 16, 2014 15:14
Trouble compiling utilities using source-built OpenFOAM Artur OpenFOAM Programming & Development 14 October 29, 2013 10:59
ParaView Compilation jakaranda OpenFOAM Installation 3 October 27, 2008 11:46
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24


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