CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] Froude Number in Paraview

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 18, 2015, 03:32
Default Froude Number in Paraview
  #1
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

I am trying to get the Froude Number in my river simulation. Therefore I need the height of the water. The problem is that my geometry itself has different height (ramps etc.). Hence this I made the following steps:

  1. Made a contour plot with Alpha = 0,5 (Water/Air surface)
  2. Extract Surface (Suggested by Bruno for stabilized heigth calculation)
  3. Calculator -> Resultname: Waterheight_1 with point coordinates and coordsZ


Still now everything is fine but the waterheight is the difference between the Waterheight_1 and the bottom surface of the river. Therefore the real water height is:
Code:
Waterheigth_1 - bottom_of_surface
I go on with the following steps:


  1. Extract Block -> bottom surface (boundary)
  2. Extract Surface (like before)
  3. Calculator -> Resultname: HeigthOfBottom with point coordinates and coordsZ
Then I grouped the datasets to have access to both Calculator results for another calculaton:


  • Calculator on Grouped Dataset -> Resultname: RealWaterHeigth with point coordinates and expression: Waterheigth_1 - HeigthOfBottom


But I will not get a new Field called "RealWaterHeigth". Also paraview does not give me an error.?

Any suggestions?
elvis and indy07cz like this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   May 9, 2017, 17:02
Default
  #2
Member
 
Honza Höll
Join Date: Mar 2016
Location: Brno, CZ
Posts: 34
Rep Power: 10
indy07cz is on a distinguished road
Hello Tobi, have you solved this problem about water height?
indy07cz is offline   Reply With Quote

Old   May 11, 2017, 09:17
Default
  #3
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

this is a long time ago and was not really important for me. I am not sure if I got the problem solved using paraview or by some own application. So I am sorry not to give more advanced information. If you will find any solution, the community would be very thankful to you.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   September 13, 2017, 10:16
Default
  #4
Member
 
Honza Höll
Join Date: Mar 2016
Location: Brno, CZ
Posts: 34
Rep Power: 10
indy07cz is on a distinguished road
Hi, I try to solve water surface elevation (depth) problem in Paraview.
According to this post p_rgh in OF 1.7, I evaluated depth (then Froude number) in calculator like h=(p_rgh-p)/(rho*g). Results seem to be reasonable, but water surface requires fine mesh. Can anybody confirm this approach?
indy07cz is offline   Reply With Quote

Old   November 30, 2017, 03:58
Default
  #5
Member
 
Honza Höll
Join Date: Mar 2016
Location: Brno, CZ
Posts: 34
Rep Power: 10
indy07cz is on a distinguished road
Hi again,
approach I described above seems not work for geometry with bed elevation changing.
For those who want to evaulate Froude number for any profile (slice) of river or channel, etc. I found better solution.
  1. Compute average velocity (v) for profile: calculator->cell data->velocity=mag(U)/Area
  2. Compute mean depth (y) again with calculator: cell data->y=Area/channel width
  3. Compute Froude number: cell data-> Fr=v^2/g.y
Now you can move slice and according to Froude number decide where the flow changes from subcritical to supercritical (and vice versa).


I think for channel flow is not necessary to know Froude number for every cell.
indy07cz is offline   Reply With Quote

Old   July 23, 2021, 12:29
Default Follow up Questions: Calculating Froude Number in Paraview
  #6
New Member
 
Alfa
Join Date: Apr 2021
Location: Germany
Posts: 3
Rep Power: 5
alfa.fauzi is on a distinguished road
Hi everyone,

I am using 3D interFoam (water-air) and currently trying to calculate the Froude Number in Paraview. I have quite complex geometry comprising river channel, weir, piers and retention area. I have tried several options but still unable to get the desired correct way to do it. These are the options that I have tried:

1. Like the one did earlier by @Tobi (Froude Number in Paraview), so when trying to subtract the surface height to bottom height in order to get the water level (height) from inside the "Group Dataset", Paraview did not yield any subtracted value. Some guys in the forum (I forgot the link) have also recommended to use "Append Dataset" but it doesn't work (after choosing both datasets, when clicking filter, this "Append Dataset" filter doesn't show up).

2. Try to use "pressure" to indicate water level. I am able to extract the water level (height) approximated by the hydrostatic pressure which is also valid I think and requires less steps compared to No. 1 above. I use only the bottom/wall patches to obtain the hydrostatic pressure. However I need to combine this datasets with the surface velocity datasets since this is obtained from the "Internal Mesh" (not from bottom patches like the pressure). As usual, when trying to combine the height datasets with velocity datasets, again failed to operate (calculate) variables inside the grouped datasets like in No. 1 above.

3. Trying to estimate the mean velocity from bottom/shear stress. I am not sure if this is a correct way to do this since there will be many assumptions and approximation. However in order to calculate without needing to combine several datasets, I can do this since I only need to load the base/wall patch in Paraview where all of these variables are included in these patches hence no need to combine several datasets. Has someone tried something similar to this? The principle is trying to obtain all needed variables from same patches e.g. use only bottom patches without using "internal mesh" so that no need to combine different datasets.

4. Further question regarding how to integrate/average velocity over depth? Integrate variables filter only works to integrate all variables regardless of direction, components, etc. so it only yields single value whereas I need to integrate certain position (x,y) over z coordinate.

I therefore invite you to add comments and advise regarding to this



Regards,
Alfa
alfa.fauzi is offline   Reply With Quote

Old   August 27, 2021, 08:47
Default
  #7
Member
 
Honza Höll
Join Date: Mar 2016
Location: Brno, CZ
Posts: 34
Rep Power: 10
indy07cz is on a distinguished road
Hi,
I've tried several ways but crucial thing is to obtain depth because you need that to compute Fr. To compute depth you need distance between point in internal mesh and point at boundary which have the same x,y coordinate. And I haven't found a way to get that. You can measure distance between two datasets with cells that have the same id (ie deformation). Therefore the group dataset can't work because paraview doesn't know which of z-coordinates from several datasets he should count in. Maybe there is a way how to join attributes from another dataset based on coordinates but I haven't found that.

In conclusion it would be great to have depth variable for datasets like Flow-3D has but I think it is not possible. You can use several slices in your geometry and compute Fr in these slices acording my reply above.



Honza
indy07cz is offline   Reply With Quote

Old   May 2, 2023, 11:20
Default Paraview Programmable Filter to depth-average
  #8
New Member
 
Kate Bradbrook
Join Date: Nov 2015
Posts: 12
Rep Power: 10
KateBradbrook is on a distinguished road
First use calculator on results dataset to get vel=mag(U)
Then use ResampleToImage with default 100x100x100
The select programmableFilter, click "Copy Arrays" and paste in following code (also in attachment as indents don't seem to show up properly below):


# Code for 'Script'.
#Note click "Copy Arrays" option to keep alpha.water to plot surface contour later
import numpy as np
#RequestData (First calc mag(U)-> vel, then ResampleToImage 100x100x100)
input0=inputs[0]
#set up variables
dp = input0.PointData["p"]/9810
dv = input0.PointData["vel"]
da = input0.PointData["alpha.water"]

#Loop through x,y directions
for i in range(0, 100):
for j in range(0, 100):
#vertical averaging
dmax=0
vsum=0
asum=0
for k in range(0, 100):
id=(k*10000)+(j*100)+i
vsum=vsum+dv[id]*da[id]
asum=asum+da[id]
if dp[id]>dmax:
dmax=dp[id]
#assign vertical averages throughout depth
vAv = 0
if dmax>0:
vAv = vsum/asum
for k in range(0, 100):
id=(k*10000)+(j*100)+i
dp[id]=dmax
dv[id]=vAv

output.PointData.append(dp,"depth")
output.PointData.append(dv,"avVel")

#Now can use calculator to get Froude Number :-)
Attached Files
File Type: txt paraView_DepthAveraging.txt (920 Bytes, 4 views)

Last edited by KateBradbrook; May 2, 2023 at 11:43. Reason: indents for code didn't copy properly so file added too
KateBradbrook 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
[snappyHexMesh] snappyHexMesh does not create any mesh except one for the reference cell Arman_N OpenFOAM Meshing & Mesh Conversion 1 May 20, 2019 17:16
[mesh manipulation] Mesh Refinement Luiz Eduardo Bittencourt Sampaio (Sampaio) OpenFOAM Meshing & Mesh Conversion 42 January 8, 2017 12:55
[OpenFOAM.org] OF2.3.1 + OS13.2 - Trying to use the dummy Pstream library aylalisa OpenFOAM Installation 23 June 15, 2015 14:49
Stable boundaries marcoymarc CFX 33 March 13, 2013 06:39
Unaligned accesses on IA64 andre OpenFOAM 5 June 23, 2008 10:37


All times are GMT -4. The time now is 12:51.