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

[Other] Surface aligned mesh

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 27, 2006, 08:02
Default Surface aligned mesh
  #1
New Member
 
Radoslaw Pasiok
Join Date: Mar 2009
Location: Poznan, Poland
Posts: 6
Rep Power: 17
rpasiok is on a distinguished road
Hello FOAMers,

inspired by hftga2foam I thought about an utility for stretching a mesh or align it with a surface.
I use OpenFOAM to simulate flows around various hydraulic structures with scoured irregular bed and the bottom mesh always cause my headakes.

I tried to code such an utility and here is what it does:
  • reads an initial mesh
  • reads 2 surface files, i.e new bottom and top of the mesh (supported extensions are '.ftr', '.stl', '.stlb', '.gts', '.obj', '.ac', '.off' and '.tri');
  • moves mesh points in the Z direction so that the bottom and top faces are aligned with the surfaces - internal mesh points keep their relative distance between bottom and top faces during the transformation;
  • writes the new mesh to the next time step directory.
Sources and examples of the utility can be found on the wiki page:
http://openfoamwiki.net/index.php/Contrib_AlignMeshSurf

Shortcomings of the code:
  • both surfaces must cover original mesh in the XY-plane - it crashes if there's no surface point to read for any of mesh point t move
  • curently it moves the mesh only in the Z direction
I'm still looking for reasonable free (GPL-ed) surface generator. Usually I start with a grid of points or isolines and there's need for a non-linear interpolation / smoothing.
If you use or know about such tool, please, let me know.

Regards,

Radoslaw Pasiok
rpasiok is offline   Reply With Quote

Old   November 27, 2006, 10:22
Default Why don't you just use the aut
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Why don't you just use the automatic mesh motion solver - that will allow you to move all boundaries in any way you like and allow you to control the mesh grading etc.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   November 28, 2006, 04:55
Default Thank you Hrvoje for suggestio
  #3
New Member
 
Radoslaw Pasiok
Join Date: Mar 2009
Location: Poznan, Poland
Posts: 6
Rep Power: 17
rpasiok is on a distinguished road
Thank you Hrvoje for suggestion!
I would love to use the solver and I will in the future. Meanwhile I didn't want to jump into the dynamic mesh stuff as I regarded it to much complicated for my static problem. Maybe that was wrong impression...

I should know already that in the OpenFOAM I should check twice for ready to use solutions before I try to do something myself :-/

Radoslaw Pasiok
rpasiok is offline   Reply With Quote

Old   November 28, 2006, 05:33
Default Have a look at the moveMesh ap
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Have a look at the moveMesh application: there is a field called motionU, you specify the motion of the boundary, run moveMesh and... you're done!

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   November 29, 2006, 11:01
Default Thank you Hrvoje once again, I
  #5
New Member
 
Radoslaw Pasiok
Join Date: Mar 2009
Location: Poznan, Poland
Posts: 6
Rep Power: 17
rpasiok is on a distinguished road
Thank you Hrvoje once again, I had a look at the moveMesh & friends and it looks really great.

But still the main problem is to specify motionU. Please keep in mind that, in general, my surface is irregular.
What is the most elegant way of finding motionU if a patch is going to change its shape? More precisely, I want all patch points to move in a common direction but various distances.

In the alignMeshSurf the direction is assumed and the hitPoint of triSurfaceSearch is used to find the distance at each mesh point. Here I would need hitPoint only for patch points to know their distance to the surface. Then I would write the distances to motionU in similiar manner as it is done with motionDiff in setMotionMovingCone (newMovingCone case of icoDyMFoam).
Or is there something better? Thank you in advance for any suggestions.

Radoslaw Pasiok
rpasiok is offline   Reply With Quote

Old   November 29, 2006, 12:58
Default Have a look at the PrimitivePa
  #6
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Have a look at the PrimitivePatch class and projectPoints:

//- Project vertices of patch onto another patch
template <class>
List<objecthit> projectPoints
(
const ToPatch& targetPatch,
const vectorField& projectionDirection,
const intersection::algorithm alg = intersection::FULL_RAY,
const intersection::direction dir = intersection::VECTOR
) const;

objectHit gives you both the distance and location of projected point.

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   January 7, 2008, 05:55
Default related thread
  #7
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18
maka is on a distinguished road
related thread
maka is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[Gmsh] Error : Self intersecting surface mesh, computing intersections & Error : Impossible velan OpenFOAM Meshing & Mesh Conversion 3 October 22, 2015 11:05
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 09:38
Cluster ID's not contiguous in compute-nodes domain. ??? Shogan FLUENT 1 May 28, 2014 15:03
[snappyHexMesh] Layers:problem with curvature giulio.topazio OpenFOAM Meshing & Mesh Conversion 10 August 22, 2012 09:03
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 21:11


All times are GMT -4. The time now is 18:36.