CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[blockMesh] Import bathymetry to OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Peida
  • 1 Post By TomS

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 2, 2019, 20:51
Default Import bathymetry to OpenFOAM
  #1
New Member
 
Peida Han
Join Date: Nov 2019
Location: Beijing, China
Posts: 6
Rep Power: 6
Peida is on a distinguished road
Dear all,
Nice to see you guys, I’m a new user and I have a terrain .txt file. I would like to mesh that.

I used this terrain meshing tutorial: tutorials/mesh/moveDyamicMesh/SnakeRiverCanyon.

Firstly, I used MeshLab to convert my .txt file (3 colume, x-coordinate, y-coordinate and height) into .stl file, then I modified the tutorial to generate the mesh.

But it seems that the mesh is weird with sharp edge, and OF shows that the geometry check is failed.

Here is my result and my code.

Thanks a lot and look forward to you reply lol

(Result when I run SnakeRiverCanyon, show Time=1 for example)
Time = 1
surfaceDisplacement : on patch minZ did not project 3 out of 40401 points.
GAMG: Solving for cellDisplacementx, Initial residual = 1, Final residual = 8.64577e-09, No Iterations 9
GAMG: Solving for cellDisplacementy, Initial residual = 1, Final residual = 3.93566e-09, No Iterations 10
GAMG: Solving for cellDisplacementz, Initial residual = 1, Final residual = 7.4888e-09, No Iterations 8
Point usage OK.
Upper triangular ordering OK.
Topological cell zip-up check OK.
Face vertices OK.
Face-face connectivity OK.
Mesh topology OK.
Boundary openness (-8.37097e-19 -3.83493e-19 -3.45847e-15) OK.
***High aspect ratio cells found, Max aspect ratio: 1.20381e+106, number of cells 183
Minimum face area = 0.00609877. Maximum face area = 8965.54. Face area magnitudes OK.
***Zero or negative cell volume detected. Minimum negative volume: -5266.04, Number of negative volume cells: 183
Mesh non-orthogonality Max: 179.979 average: 3.31798
*Number of severely non-orthogonal (> 70 degrees) faces: 2268.
***Number of non-orthogonality errors: 603.
***Error in face pyramids: 1449 faces are incorrectly oriented.
***Max skewness = 584.992, 56 highly skew faces detected which may impair the quality of the results
Failed 5 mesh geometry checks.
Failed 1 mesh checks
.
ExecutionTime = 14.58 s ClockTime = 15 s
Attached Images
File Type: jpg mesh.jpg (31.8 KB, 41 views)
tukkuezgi likes this.

Last edited by Peida; December 3, 2019 at 12:01. Reason: something unclear
Peida is offline   Reply With Quote

Old   December 2, 2019, 20:52
Default
  #2
New Member
 
Peida Han
Join Date: Nov 2019
Location: Beijing, China
Posts: 6
Rep Power: 6
Peida is on a distinguished road
I feel like my problem results from .stl file.

Firstly, I generate my .stl file from XYZ.file (x coordinate, y coordinate and height) by Meshlab . Then I run my case modified by Snakeriver and the result is not good (the bottom of block moves to stl surface but sharp edge appears.)

so I try to convert .stl file by Matlab, the code shows below:

[X,Y,Z]=textread('AcrossRiver.txt','%f %f %f');

% triangulate in xy
T = delaunay(X,Y);
% create triangulation in 3d
tri = triangulation(T,X,Y,Z);
% plot
patch('Faces',tri.ConnectivityList,'Vertices',tri. Points,'FaceColor','red');
% now save
stlwrite(tri,'jisadas.stl');

The result gets better, the show time of the sharp edge delays. But it still shows up.

Last edited by Peida; December 3, 2019 at 11:46.
Peida is offline   Reply With Quote

Old   December 2, 2019, 20:53
Default
  #3
New Member
 
Peida Han
Join Date: Nov 2019
Location: Beijing, China
Posts: 6
Rep Power: 6
Peida is on a distinguished road
So I wonder that if there is anyway to generate high-quality .stl file.
And here is my .stl file
Oops, it‘s too big...

Last edited by Peida; December 3, 2019 at 12:02.
Peida is offline   Reply With Quote

Old   December 4, 2019, 17:49
Default
  #4
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
- if you have CAD file of the geometry, instead of STL, use SALOME or Blender to create surface mesh, i.e. STL
HPE is offline   Reply With Quote

Old   December 5, 2019, 08:44
Default
  #5
New Member
 
Peida Han
Join Date: Nov 2019
Location: Beijing, China
Posts: 6
Rep Power: 6
Peida is on a distinguished road
Quote:
Originally Posted by HPE View Post
- if you have CAD file of the geometry, instead of STL, use SALOME or Blender to create surface mesh, i.e. STL
Dear HPE,

Thanks for your suggestion. I have CAD and I wonder that what is SALOME or Blender, utilities in OF?

And I have figured out my problem:

If you use moveDynamic turorial, you should care the ratio of the xyz resolution. If z-resolution is too low, the result will get bad.

Peida
Peida is offline   Reply With Quote

Old   May 4, 2020, 11:55
Default Bathymetry and OpenFOAM
  #6
New Member
 
TomS's Avatar
 
Join Date: Oct 2010
Posts: 21
Rep Power: 15
TomS is on a distinguished road
Glad you managed to resolve your issues, Peida.

The STL attached was generated using a combination of SALOME and MeshLAB. It was then used for a littoral flow study using OpenFOAM:

https://www.mts-cfd.com/loch-erisort

Best wishes,

Tom
Attached Images
File Type: jpg bathymetry_2.jpg (168.0 KB, 36 views)
HPE likes this.
TomS is offline   Reply With Quote

Reply

Tags
terrain mesh


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
How to import single STL file to openfoam in Windows 10 Jinjolee OpenFOAM Pre-Processing 9 May 19, 2023 10:03
how to import the CAD drawing into openfoam shadyenany OpenFOAM 9 March 22, 2021 11:26
OpenFOAM 4.0 Released CFDFoundation OpenFOAM Announcements from OpenFOAM Foundation 2 October 6, 2017 05:40
[Commercial meshers] import ansys meshing to openfoam bhrz OpenFOAM Meshing & Mesh Conversion 2 November 11, 2014 11:41
Did anyone worked on GID mesh import in OpenFoam?? Tushar@cfd OpenFOAM 2 May 31, 2011 12:01


All times are GMT -4. The time now is 08:38.