Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Computing the average velocity

Computing the average velocity 10 years 1 month ago #14388

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

An alternative method is to use Blue Kenue. (no programming required)

For the purpose of illustration let's assume you want the average hourly current in some area.

1. Define a polygon of your area
2. Select your "VELOCITY UV" object in the workspace.
3. Select "Tools->Extract TimeSeries->Constrained By..."
a. on the dialog select "Average" in the "Generate a Timeseries of" dropdown.
b. select your polygon in the "Where nodes are within the polygon" dropdown.
4. press OK. You will now have a timeseries of the average velocity at all nodes that fall within your polygon, at the timestep of your result file.

Now to generate hourly average values...

1. Select the timeseries created above in the workspace.
2. Select "Tools->TimeSeries->Resample"
3. Select "Interval Means" as the Resample method and set the DeltaT field to 1:00:00
4. Press OK. You now have a new timeseries with your desired result.

Hope this helps... Martin
The administrator has disabled public write access.
The following user(s) said Thank You: Svensmolders, mary

Computing the average velocity 10 years 1 month ago #14389

  • Svensmolders
  • Svensmolders's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 105
  • Thank you received: 20
Hi Martin,

I work together with Maria. Your solution is very interesting. something that I din't know yet was possible in Blue Kenue.
If it was only one polygon this would be a great solution, but we have 85 polygons and different scenarios (we analyze the diffusion of different tracers)
Is there by chance a way of making a script that automates all the steps you suggested in Blue Kenue?

Are you by chance coming to the user conference this year?


Best regards,

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

Computing the average velocity 10 years 1 month ago #14395

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

We have a python interface to all the BlueKenue/EnSim class libraries but it's not yet ready for public consumption.

Unfortunately, I won't be at the meeting this year.

Martin
The administrator has disabled public write access.

Computing the average velocity 10 years 1 month ago #14391

  • mary
  • mary's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 33
  • Thank you received: 1
Hello Jean Michel,

I'm sorry but I think I did not well explained. I need a single formatted results file with values of an averaged variable (for instance the tracer) defined for each node. What would be the code lines to write this unique file in parallel mode besides defining T3DRFO to SCAL?


Kind regards,
Maria
The administrator has disabled public write access.

Computing the average velocity 10 years 1 month ago #14392

  • jmhervouet
  • jmhervouet's Avatar
Hello Maria,

This is very complicated unless it is very heavy, I give you the very heavy solution, written for 2D, but for 3D just add a loop on planes:

You need to know the global number of points, let's call it NGLOB (for instance it is the maximum over all processors of MESH%KNOLG%I(I) for I=1 to local number of points. Compute it over every processor, then NGLOB=P_IMAX(NGLOB).

Then:

DO I=1,NGLOB
ILOC=0
DO J=1,NPOIN
! Is this point in the sub-domain ?
IF(MESH%KNOLG%I(J).EQ.I) ILOC=J
ENDDO
IF(ILOC.GT.0) THEN
VALUE= your averaged value at point ILOC
ELSE
VALUE=0.D0
ENDIF
! this will get the non zero value where it is, be it positive or negative
! if it is in 2 or more sub-domains, no problem
IF(NCSIZE.GT.1) VALUE=P_DMIN(VALUE)+P_DMAX(VALUE)
! Only processor 0 will write
IF(IPID.EQ.0) THEN
WRITE(LU,T3DRFO) 'POINT ',I,' VALUE : ',VALUE
ENDIF
ENDDO

Not tested, just to give you the main idea, I hope it works,

Have a nice week-end,

Jean-Michel
The administrator has disabled public write access.

Computing the average velocity 10 years 1 month ago #14393

  • mary
  • mary's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 33
  • Thank you received: 1
Hello Jean-Michel,

Thank you a ton for your reply. Just one more quick question: the variable MESH%KNOLG%I(J) still exists? I don't find it defined anywhere.

Thank you again and have a nice weekend!
Maria
The administrator has disabled public write access.

Computing the average velocity 10 years 1 month ago #14394

  • jmhervouet
  • jmhervouet's Avatar
Yes, MESH%KNOLG%I still exists, we have suppressed KNOGL (global to local) which had a huge size compared to other arrays.

JMH
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: pham

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