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

Handling profile files with matlab

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 13, 2005, 08:23
Default Handling profile files with matlab
  #1
Ralf Schmidt
Guest
 
Posts: n/a
Hello,

I am searching for a Matlab code, which can re-sort the profile files that are written by Fluent. Fluent typically writes all the values (e.g. x-, y- and z coordinate, x-,y- and z-vel.) in one series one after another. I want to have them as a matrix, if possible as numerical format (integer).

Thanks in advanced

Ralf
  Reply With Quote

Old   July 15, 2005, 06:55
Default Re: Handling profile files with matlab
  #2
Ralf Schmidt
Guest
 
Posts: n/a
Hello,

I am proud to present the matlab code I have developed. The comments are in German, but it is not so difficult to understand.

But there is still a problem: It work fine with a self written sample file, but not with the original fluent code!

The columns have different length!!!!! Where is the Problem???

See also http://www.cfd-online.com/Forum/fluent.cgi?read=29319

can someone help me??

Ralf

______________

clear all;

sim_quellpfad = 'D:\Ralf\Simulation\';

% Pfad des Verzeichnisses in dem die Dateien stehen

sim_zielpfad = 'D:\Ralf\Simulation\';

sim_daten_name = 'Geometrie_02_x-395' ; % Name der Fluent Datei

sim_dateiname = [sim_quellpfad sim_daten_name '.txt'];

sim_daten01 = fopen(sim_dateiname,'r'); % Laden der Fluent Datei

L_S = 1930; % Anzahl der Werte in einer Datei

for k = 1:2 % die ersten 3 Zeilen der Datei sind der "header", die Zeilen werden gelesen und ignoriert

fgets(sim_daten01); end

for j = 1:7 % Auswertung für 7 Werte (x-, y- und z-koordinate, vx, vy, vz und vel.mag.)

for i = 1:L_S

sim_datenXXa = fscanf(sim_daten01, '%f', 1); % mit fscanf wird eine neue Datei erstellt (nach dem ersten Wert wird ein Zeilenumbruch gemacht)

sim_datenXX(i,j) = sim_datenXXa; % die Werte werden in eine Matrix geschrieben

end

for k = 1:3 % die folgenden 2 Zeilen sind der "header", die Zeilen werden gelesen und ignoriert

fgets(sim_daten01);

end

end fclose(sim_daten01);
  Reply With Quote

Old   July 15, 2005, 07:32
Default Re: Handling profile files with matlab
  #3
dirk
Guest
 
Posts: n/a
Hallo Ralf,

ich schicke Dir mal eine Funktion aus einem meiner Programme. Damit lassen sich auch die Werte mehrerer Ebenen innerhalb einer Profildatei auslesen. Die einzelnen Spalten müssen eigentlich immer genauso lang sein.

Dirk
  Reply With Quote

Old   July 18, 2005, 06:39
Default Re: Handling profile files with matlab
  #4
Ralf Schmidt
Guest
 
Posts: n/a
Hi!

I solved the problem: The data were damaged due to the SSH client I used for getting the data from the workstation with Fluent running on to my PC.

The SSH Client transfer mode was "auto-select" and in this mode, some part of the data were cut. Now it is "binary" and it workes fine!

Ralf
  Reply With Quote

Reply

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
UDF issue MASOUD Fluent UDF and Scheme Programming 14 December 6, 2012 14:39
critical error during installation of openfoam Fabio88 OpenFOAM Installation 21 June 2, 2010 03:01
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found piprus OpenFOAM Installation 22 February 25, 2010 14:43
Problems in compiling paraview in Suse 10.3 platform chiven OpenFOAM Installation 3 December 1, 2009 08:21
Associating profile files for the UDS though a UDF Bharath FLUENT 0 December 1, 2006 16:58


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