Welcome, Guest
Username: Password: Remember me

TOPIC: Seeking Assistance with MATLAB Code for Calculating Flow Rate Across

Seeking Assistance with MATLAB Code for Calculating Flow Rate Across 10 months 2 weeks ago #43906

  • mnxhu
  • mnxhu's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 23
Hello everyone,

I am currently working on a project where I need to calculate the flow rate across a specific section of a strait using data from Telemac simulations. The simulation results are in SLF file format, and I am planning to use MATLAB for this analysis.

However, I am encountering some challenges with reading the SLF files and extracting the necessary data to compute the flow rate. I am seeking assistance or guidance on how to approach this problem effectively. Specifically, I need help with the following:

Reading SLF Files in MATLAB: Is there a MATLAB script or function available that can read Telemac SLF files? I need to extract flow velocity and water depth data for a particular cross-section.

Calculating Flow Rate: Once I have the velocity and depth data, how should I go about calculating the flow rate across the section? I am aware that it involves integrating the product of velocity and depth across the section, but I am unsure how to implement this in MATLAB, considering the SLF file structure.

Handling Complex Channel Geometries: The strait section I am studying has a complex geometry. Are there any specific considerations or tips I should keep in mind while extracting data and calculating flow rate for such a section?

Any scripts, code snippets, tutorials, or general advice on how to handle SLF files in MATLAB and calculate flow rates would be greatly appreciated. Also, if anyone has worked on a similar project or has relevant resources, please share.

Thank you in advance for your time and help!

Best regards,
[mnxhu]
The administrator has disabled public write access.

Seeking Assistance with MATLAB Code for Calculating Flow Rate Across 10 months 2 weeks ago #43907

  • Renault
  • Renault's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 120
  • Thank you received: 33
Hello mnxhu,

I haven't done this myself, but off the top of my head:
  • Check out section 5.2 of the TELEMAC-2D user manual on "control sections".
  • The only examples I could find in the OTM examples were telemac2d/flotteurs and waqtel/tracer_decay, you may want to look at how they implement control sections.
  • I strongly recommend working with Python instead of MATLAB for better interactivity with OTM, but that's just me.

Otherwise, my advice is to use ParaView to post-process Selafin files. It has a steep learning curve, but you can do such things as take a cross-section of the results and do math based on those results, and you can also "record" your actions so ParaView can write a Python script based on your actions for repeatability. You can use converter.py to generate .vtk files from the .slf files (read the STBTEL manual for more info). ParaView has a steep learning curve, but I have found it well worth it; for example, for my master's, I had to do statistics on the sediment composition of the bed, and ParaView let me automate this process across multiple files.

I hope this helps, and I hope others have advice more helpful than mine! :laugh:

André Renault
The administrator has disabled public write access.
The following user(s) said Thank You: mnxhu

Seeking Assistance with MATLAB Code for Calculating Flow Rate Across 10 months 2 weeks ago #43914

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello,

In addition to André's already quite good answer, you can also have a look at the FLUXLINE feature.

You can also try to use FUDAA-PREPRO post-processing tool which only requires java and can be run on Linux and Windows.
Perhaps Blue Kenue does it as well but I cannot use it.

Hope this helps,

Chi-Tuan
The administrator has disabled public write access.
The following user(s) said Thank You: mnxhu

Seeking Assistance with MATLAB Code for Calculating Flow Rate Across 10 months 2 weeks ago #43919

  • DeVos_TUM
  • DeVos_TUM's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 22
  • Thank you received: 4
Hello mnxhu,

here you can find some functions to read SLF files in Matlab (though I think they do not work with double precision):
www.mathworks.com/matlabcentral/fileexch.../25021-telemac-tools

As for calculating the flow rate:
There are certainly different ways of achieving this, but we usually interpolate the data on distribruted points of the cross-section (scatteredInterpolant) and then integrate using the trapz function.

HOWEVER:
I also strongly recommend using Python for this. In the provided notebooks there are some examples where this is already done and simply adjusting those notebooks to your case might be easier than using Matlab.

Frederik
The administrator has disabled public write access.
The following user(s) said Thank You: mnxhu

Seeking Assistance with MATLAB Code for Calculating Flow Rate Across 10 months 2 weeks ago #43944

  • Serrer
  • Serrer's Avatar
  • OFFLINE
  • Moderator
  • Posts: 720
  • Thank you received: 304
Hi All,

It is also possible to use Blue Kenue to compute fluxes across arbitrary sections.
Please refer to post #4189 in the Blue Kenue Section of this forum for a discussion.

Hope this helps... Martin
The administrator has disabled public write access.
The following user(s) said Thank You: mnxhu
Moderators: pham

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.