Outils pour utilisateurs

Outils du site


sunfluidh:sunfluidh_matlab

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
sunfluidh:sunfluidh_matlab [2019/01/22 14:36] – [Reading output files with Matlab (examples)] witkosunfluidh:sunfluidh_matlab [2020/08/31 15:29] (Version actuelle) witko
Ligne 2: Ligne 2:
    
  
-Three different matlab functions can read sunfluidh output files. [[https://sunfluidh.limsi.fr/_media/sunfluidh:matlabforsunfluidh.tar|Download the files]]. Make sure the directory where you have untar these files is listed in the matlabpath((For Unix system you can add a line in ~/.bashrc such as : //export MATLABPATH='directory_where_the_files_are_stored'//)) +Three different matlab functions can read sunfluidh output files. [[https://sunfluidh.limsi.fr/_media/sunfluidh:read_sunfluidh_data.tar|download the files]]. Make sure the directory where you have untar these files is listed in the matlabpath((For Unix system you can add the following command in ~/.bashrc :  
 +//export MATLABPATH='directory_where_the_files_are_stored'//))
  
-  - **read_sunfluidh_data** reads res* or rst* files+  - **read_sunfluidh_data** reads res* or rst* files  
   - **read_sunfluidh_probes**  reads all probes files *_ins_*    - **read_sunfluidh_probes**  reads all probes files *_ins_* 
   - **read-sunfluidh-namelist** reads check_namelist_data.dat   - **read-sunfluidh-namelist** reads check_namelist_data.dat
Ligne 11: Ligne 12:
  
  
-<note important>Here, we assume you have already runned the case[[ sunfluidh:2D_channel_flow_with_bar_Incomp_Flow | 2D laminar channel flow with a constriction]]. Make sure the current directory for matlab is also the directory where you have the output files.+<note important>Here, we assume you have already run the case[[ sunfluidh:2D_channel_flow_with_bar_Incomp_Flow | 2D laminar channel flow with a constriction]]. Make sure the current directory for matlab is also the directory where you have the output files.
 </note> </note>
  
Ligne 21: Ligne 22:
 Visualisation of U velocity component. Visualisation of U velocity component.
 <file txt> <file txt>
-f = read_sunfluidh_data(7) % read res_00000_0000007.d. If you omit (7), the function tries to read the last generated file.+f = read_sunfluidh_data(7) % read res_00000_0000007.d. If you omit (7), the function tries to read the lastest generated file.
 pcolor(f.xu,f.yc,f.U') % Note the transpose ' for f.U pcolor(f.xu,f.yc,f.U') % Note the transpose ' for f.U
 axis image axis image
Ligne 83: Ligne 84:
 ===== Temporal series ===== ===== Temporal series =====
  
-The *ins* files or more generally temporal series are ascci files in which the first column is time and the first line is a header. There is no special needs to have a script for these files. You can use directly builtin matlab functions that you can taylor to your needs.+The *ins* files or more generally temporal series are ascii files in which the first column is time and the first line is a header. There is no special needs to have a script for these files. You can use directly builtin matlab functions that you can taylor to your needs.
  
-Conversely, you can use **read_sunfluid_probes.m** that attempts to read in the current directory all the *ins* files and build a structure with the variable names. It is quite fragile and may fail. 
  
 Reading the file resid_L2_Li.d with builtin matlab function Reading the file resid_L2_Li.d with builtin matlab function
Ligne 95: Ligne 95:
 semilogy(time,L2) semilogy(time,L2)
 grid on grid on
-xlabel('t'); ylabel('L2 norm')+xlabel('t','FontSize',16); ylabel('L2 norm','FontSize',16) 
 +set(gca,'FontSize',16)
 </file> </file>
  
Ligne 108: Ligne 109:
 </file> </file>
  
-Using read_sunfluidh_probes.m makes the same job a bit easier.+You can use **read_sunfluid_probes.m** that attempts to read in the current directory all the *ins* files and build a structure with the variable names. It intends to make life a bit easier but it is however quite fragile and may fail. 
 + 
 +Exemple:
 <file txt> <file txt>
 s = read_sunfluidh_probes; s = read_sunfluidh_probes;
-plot(s.time,s.u(:,2))+plot(s.time,s.u(:,2)) % to plot u velocity component for probe number 2
 </file> </file>
  
sunfluidh/sunfluidh_matlab.1548164165.txt.gz · Dernière modification : 2019/01/22 14:36 de witko

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki