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

Edge alignment in Boundary Layer y+ adaptation

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By GBarraza

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2020, 08:26
Default Edge alignment in Boundary Layer y+ adaptation
  #1
New Member
 
Join Date: Dec 2018
Posts: 6
Rep Power: 7
GBarraza is on a distinguished road
Hi everyone!

This is my very first post in the forum! I hope you can help me out with the problem I'm facing at the moment. (If my post is not in the correct forum channel, let me know )

NOTE: If you are not really interested on the explanation, at the bottom is the real question

I am writing a functionObject which adapts (no refinement) the first layer cell thickness at runtime given a target y+ value. For this I impose a displacement on the first layer cells based on a ratio, and solving the cell displacement based on a custom equation.

Currently, I have achieved to displace the first cell successfully, and adapting the rest of the cells in the far field with a smoothing algorithm. However, when I displace the cells towards the wall, the edges which originally were normal to the wall become a bit tilted. The problem is when the fist cell really close to the wall, since a small bit of distortion causes a big non-orthogonality on those cells, making my simulation crash.

To this end, I implemented an edge correction for the first layer of cells which guarantees that the edges of the layer remain normal to the wall. But, then the layers above get distorted.

Question: Is there a straightforward way to get the edges above (e.g. the next 5 layers), or keep the edges aligned?

I have tried looking in the SnappyLayerDriver.C to come up with an analogy, but no success so far.

I attach an image so the problem is better understood.

Thanks in advance!!!
Guillermo
Attached Images
File Type: jpg distorted_layers.jpg (78.8 KB, 13 views)
GBarraza is offline   Reply With Quote

Old   May 12, 2020, 21:47
Default
  #2
New Member
 
Fan
Join Date: Apr 2020
Posts: 5
Rep Power: 5
Fann is on a distinguished road
Hi GBarraza,

I'm sorry I don't have the ability to answer your question, but I have a question similar to yours. I want to know, can you modify the grid points by judging the speed in the grid points? for example, when the speed reaches a certain value, Increase the position of the grid point in the z direction.
I would be very grateful if you could answer me.
Best wishs for you!
Fann
Fann is offline   Reply With Quote

Old   May 13, 2020, 07:17
Default
  #3
New Member
 
Join Date: Dec 2018
Posts: 6
Rep Power: 7
GBarraza is on a distinguished road
Hi Fann,

with regards to your question :

Quote:
Originally Posted by Fann View Post
I want to know, can you modify the grid points by judging the speed in the grid points? for example, when the speed reaches a certain value, Increase the position of the grid point in the z direction.
Fann
If you already have the interpolated field on the nodes (e.g. a volScalarField like U into a pointScalarField), then you can move an specific mesh point based on the metric field you defined (and with the moving mechanism/criteria you want to apply)

I'll leave you an example:

Code:
//Interpolation of velocity field U
const volVectorField& U = mesh_.lookupObject<const volVectorField>("U");
interpolationCellPoint<vector> UInterp(U);


//Reference to mesh points field
pointField& points = mesh_.points();

//Probably you iterate over boundaries, cell points, etc...
//Example iterating over every cell's points
forAll(cellPointLabels, pointI)
{
    if (mag(UInterp[pointI]) > 10.0)
    {
        //Displacing your point by one unit in the z-direction
        points[pointI] = points[pointI] + vector(0,0,1)
    }
}

//Move the points
mesh_.movePoints(points);
;

I hope that helps you.

Guillermo
GBarraza is offline   Reply With Quote

Old   May 13, 2020, 07:21
Default
  #4
New Member
 
Join Date: Dec 2018
Posts: 6
Rep Power: 7
GBarraza is on a distinguished road
Quote:
Originally Posted by GBarraza View Post

Question: Is there a straightforward way to get the edges above (e.g. the next 5 layers), or keep the edges aligned?

I have already found my way to solve the problem. Thanks anyway!
GBarraza is offline   Reply With Quote

Old   May 13, 2020, 16:47
Default
  #5
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
Hi

- Is it possible to elaborate how you had managed to solve the issue, if possible?

Many thanks.
HPE is offline   Reply With Quote

Old   May 14, 2020, 04:53
Default
  #6
New Member
 
Join Date: Dec 2018
Posts: 6
Rep Power: 7
GBarraza is on a distinguished road
Sure,

As for how I managed to get the off-plane edges of the layers above the first I:

1. iterate over all patch faces, get the cell corresponding to the face and the opposing face of the boundary face.
2. Iterate over all edges of each cell and get those which are not contained neither in the boundary face nor in its opposing face.
3. Use faceOwner (or faceNeighbour) to get the cell at the other side of the opposing face.
4. Repeat the procedure for all the layers wanted.

Important to notice, it has the assumption that all the cells on the boundary are hex (or boundary layer cells).

To keep the edges aligned, I simply did a vector projection from the edges of the new mesh into the edges of the old one.

I hope it helps of something.

Guillermo
jherb and HPE like this.
GBarraza 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
Wind turbine simulation Saturn CFX 58 July 3, 2020 01:13
Error - Solar absorber - Solar Thermal Radiation MichaelK CFX 12 September 1, 2016 05:15
Radiation interface hinca CFX 15 January 26, 2014 17:11
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44
[snappyHexMesh] Boundary layer in a pipe Clementhuon OpenFOAM Meshing & Mesh Conversion 6 March 12, 2012 12:41


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