CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[Other] 2D flood modelling using OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By TomS

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 13, 2020, 06:42
Default 2D flood modelling using OpenFOAM
  #1
New Member
 
TomS's Avatar
 
Join Date: Oct 2010
Posts: 21
Rep Power: 15
TomS is on a distinguished road
Hi,

My name is Tom Scanlon, an independent researcher in CFD for environmental flows based in Scotland.

I have developed a methodology for 2D flood modelling using OpenFOAM which I would like to share with you. Please find documentation and further details at:


https://www.mts-cfd.com/ballater


I hope you will find this of interest.

Best wishes,

Tom


Dr Tom Scanlon BEng PhD CEng MIMechE
www.mts-cfd.com
TomS is offline   Reply With Quote

Old   February 25, 2021, 05:10
Default issue in pointToCell data
  #2
New Member
 
Shailja
Join Date: Nov 2017
Posts: 16
Rep Power: 8
Shailja is on a distinguished road
Hii Tom

Thank you for posting your paper here. I am working on similar kind of project and your paper helped me a lot to run 2D flooding case with DEM data. I am stuck at one point.

Actually I am getting one issue that after using testWall and mapFields utility from 2D mesh directory, the mapping of ywall point data seems ok from 3D mesh dir to 2D mesh dir but when I try to convert it to cell data inside 2d mesh dir (for use in 2D calculation ) using pointdataTo celldata filter in paraview, ywall data range reduces to half of its original as in 2D point data. Here I am attaching a picture.

in 3D mesh there seem no issue on conversion of point to cell data.

in attached fig pointTocell data convert(cell data) has a highest range upto 212 m while in point data range is from 0.5 to 432 m.

I also tried mapping ground elevation in form of S field parameter by extracting it using excel and putting it like fireld in ) and 1 time directory but to no use.

I wonder and thankful to you if you can help me to solve this issue
Attached Images
File Type: jpg point2cell data issue.jpg (90.0 KB, 35 views)
Shailja is offline   Reply With Quote

Old   February 25, 2021, 05:26
Default
  #3
New Member
 
TomS's Avatar
 
Join Date: Oct 2010
Posts: 21
Rep Power: 15
TomS is on a distinguished road
Hi Shailja,


It's been a while since I looked at this but is it possible for your to scale your mesh to the correct height using:



transformPoints -scale '(1 1 X)'


where X is your Z-scale factor to obtain the correct height range?


Tom
TomS is offline   Reply With Quote

Old   February 25, 2021, 06:04
Default Re:
  #4
New Member
 
Shailja
Join Date: Nov 2017
Posts: 16
Rep Power: 8
Shailja is on a distinguished road
I did it but got no change in mapped cell data value in 2D mesh. I am writing below exact process followed from my understanding of your paper:

1. make a 3D mesh using dem stl file, meshed using snappyHexMesh such that with maxZ showing stl surface. used Testwall-dist utility to get ywall in 1 time directory
2. make same area 2D mesh using blockMesh, snappy and extrude mesh utilities. now again used Test-wall to generate ywall in 2D directory . In doing so I have to change maxZ type geometry from patch/empty to wall in boundary file of polyMesh

3. Then I used mapFields ../3D-dir utility in 2D mesh to generate mapped field values ywall from 3D mesh to 2D mesh cell.

Is this the right way or I am doing some mistake??
Shailja is offline   Reply With Quote

Old   February 25, 2021, 06:22
Default
  #5
New Member
 
TomS's Avatar
 
Join Date: Oct 2010
Posts: 21
Rep Power: 15
TomS is on a distinguished road
Here is a typical list of commands I used after the 3D DEM/Testwall-Dist utility, I hope this helps:


blockMesh
surfaceFeatureExtract
snappyHexMesh -overwrite >log.snap &
tail -f log.snap

cp -r constant/polyMesh constant/polyMesh.org

Domain extent is:
Checking geometry...
Overall domain bounding box (10 10 0) (2295 2060 100)

3D mesh case extent was:

X 5 to 2300
Y 5 to 2065

So, we need to scale in X and Y by

1.004376368 in X and
1.004878049 in Y

Firstly, extrudeMesh through 4.5 m from "top" to "bottom".

extrudeMesh

edit constant/polyMesh/boundary and change "wall" to "empty"

checkMesh

Checking geometry...
Overall domain bounding box (10 10 105) (2295 2060 109.5)
Mesh has 2 geometric (non-empty/wedge) directions (1 1 0)
Mesh has 2 solution (non-empty) directions (1 1 0)
All edges aligned with or perpendicular to non-empty directions.
Boundary openness (-1.98442e-18 5.7985e-18 2.95868e-13) OK.
Max cell openness = 2.18682e-16 OK.
Max aspect ratio = 2.15121 OK.
Minimum face area = 5.88253. Maximum face area = 101.201. Face area magnitudes OK.
Min volume = 26.4714. Max volume = 455.403. Total volume = 2.09433e+07. Cell volumes OK.
Mesh non-orthogonality Max: 34.7182 average: 1.67559
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 0.984255 OK.
Coupled point location match (average 0) OK.

Mesh OK.

End

transformPoints -scale '(1.004376368 1.004878049 1)'
transformPoints -translate '(-5.0438 -5.0488 -105)'

mkdir -p 0

cp 0.org/S.org.run 0/S

mapFields -sourceTime '0' ../ballater_Aberdeen_Council_3D

transformPoints -scale '(1 1 0.2222222)'

checkMesh

Checking geometry...
Overall domain bounding box (4.99996 4.99998 0) (2300 2065 1)
Mesh has 2 geometric (non-empty/wedge) directions (1 1 0)
Mesh has 2 solution (non-empty) directions (1 1 0)
TomS is offline   Reply With Quote

Old   March 4, 2021, 01:19
Default
  #6
New Member
 
Shailja
Join Date: Nov 2017
Posts: 16
Rep Power: 8
Shailja is on a distinguished road
Thank you Tom

I followed the process in 2D case after extrudeMesh.

Its kind of partially working but still I am facing issue that height range is still at difference of values than 3D case. Also the shape of stl is not clear at all in 2D case, its kind of fuzzy.

if I keep wall type top boundary in 2D then only visualization of stl surface seems matching to 3D case but different in top and bottom geometry.

I just want to be sure that transformpoints -scale and -transform commands you have applied in 2D case only after blockmesh , surfaceFeatureExtract, snappyHexMesh and extrudeMesh ??



thank you for your help.


regards

Shailja
Shailja is offline   Reply With Quote

Old   March 4, 2021, 03:34
Default
  #7
New Member
 
TomS's Avatar
 
Join Date: Oct 2010
Posts: 21
Rep Power: 15
TomS is on a distinguished road
Hi Shalija,

The order of the commands as you list them in your post appears correct. The 3D snappy run is designed to create the S height field which is then mapped on to the 2D case. I'm not sure what else I can suggest.

Tom
TomS is offline   Reply With Quote

Reply

Tags
flooding, openfoam, shallow water equations


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
OpenFOAM 5.0 Released CFDFoundation OpenFOAM Announcements from OpenFOAM Foundation 11 June 5, 2018 23:48
OpenFOAM v3.0+ ?? SBusch OpenFOAM 22 December 26, 2016 14:24
Modelling jet fans with openFOAM matthew.legg OpenFOAM Running, Solving & CFD 0 January 12, 2016 10:10
New OpenFOAM Forum Structure jola OpenFOAM 2 October 19, 2011 06:55
CFD uses for river flood modelling? Herve Morvan Main CFD Forum 0 September 16, 1998 12:59


All times are GMT -4. The time now is 01:46.