CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [Other] 2D flood modelling using OpenFOAM (https://www.cfd-online.com/Forums/openfoam-community-contributions/225087-2d-flood-modelling-using-openfoam.html)

TomS March 13, 2020 06:42

2D flood modelling using OpenFOAM
 
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

Shailja February 25, 2021 05:10

issue in pointToCell data
 
1 Attachment(s)
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

TomS February 25, 2021 05:26

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

Shailja February 25, 2021 06:04

Re:
 
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??

TomS February 25, 2021 06:22

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)

Shailja March 4, 2021 01:19

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

TomS March 4, 2021 03:34

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


All times are GMT -4. The time now is 15:19.