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

Use of grid stretching functions in DiveMESH

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By kamath
  • 1 Post By kamath

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 23, 2022, 06:53
Default Use of grid stretching functions in DiveMESH
  #1
Member
 
YN
Join Date: Apr 2022
Posts: 32
Rep Power: 4
YNLSW911219 is on a distinguished road
Hi! When I am using reef3d,I do not understand some commands of divemesh,such as,B 101,B 102,B 103.Could you reply it?

Last edited by kamath; April 26, 2022 at 03:15. Reason: edited title for better visibility
YNLSW911219 is offline   Reply With Quote

Old   April 25, 2022, 03:52
Default
  #2
Senior Member
 
Arun Kamath
Join Date: Nov 2014
Location: Trondheim, Norway
Posts: 265
Rep Power: 13
kamath is on a distinguished road
The commands you name are relvant if you are using a stretched grid fro your simulations.

For eg.
B 1 0.05
B 10 0.0 10.0 0.0 0.05 0.0 1.0
Will result in a two-dimensional domain that is 10 m long in the x-direction, 1 cell wide (2D) and 1 m high.
In this domain, the grid size is dx=dy=dz= 0.05 m in all directions, with a total of 4000 grids (see fig1)

On the other hand, if you want finer meshes in a part of the domain compared to the rest, you can apply a stretched mesh. For eg.

B 2 200 1 20
B 10 0.0 10.0 0.0 0.05 0.0 1.0

B 101 5
B 111 2.0
B 114 5.0

B 103 5
B 111 2.0
B 116 0.5

will create a mesh with 4000 cells but with a focus point for x-grids at x=5.0 m, and z=0.5 m. The stretching factor is 2.0. This will result in a mesh as seen in Fig 2.
The file DIVEMesh_Log/DIVEMesh-Non-Uniform-Mesh.txt will show you the max and min sizes of the grids and the location of the finest grid.
This example uses a simple sinh function based stretching. Other options can be explored in the B 101/2/3 commands to define different types of grid stretching.

Hope that helps.

PS. stretching factor of 3.0 is used purely for demonstration. In practical cases, this might be too high. You need check the aspect ratios of the grids in the DIVEMesh-Non-Uniform-Mesh.txt file and is recommended to keep the maximum cell ratios to around 1.05 or lower to ensure simulation stability.
Attached Images
File Type: jpg Fig1.jpg (55.1 KB, 71 views)
File Type: jpg Fig2.jpg (60.5 KB, 81 views)
raul_xusernamex_ likes this.
__________________
Arun
X years with REEF3D
kamath is offline   Reply With Quote

Old   April 25, 2022, 08:50
Default
  #3
Member
 
YN
Join Date: Apr 2022
Posts: 32
Rep Power: 4
YNLSW911219 is on a distinguished road
Quote:
Originally Posted by kamath View Post
The commands you name are relvant if you are using a stretched grid fro your simulations.

For eg.
B 1 0.05
B 10 0.0 10.0 0.0 0.05 0.0 1.0
Will result in a two-dimensional domain that is 10 m long in the x-direction, 1 cell wide (2D) and 1 m high.
In this domain, the grid size is dx=dy=dz= 0.05 m in all directions, with a total of 4000 grids (see fig1)

On the other hand, if you want finer meshes in a part of the domain compared to the rest, you can apply a stretched mesh. For eg.

B 2 200 1 20
B 10 0.0 10.0 0.0 0.05 0.0 1.0

B 101 5
B 111 2.0
B 114 5.0

B 103 5
B 111 2.0
B 116 0.5

will create a mesh with 4000 cells but with a focus point for x-grids at x=5.0 m, and z=0.5 m. The stretching factor is 2.0. This will result in a mesh as seen in Fig 2.
The file DIVEMesh_Log/DIVEMesh-Non-Uniform-Mesh.txt will show you the max and min sizes of the grids and the location of the finest grid.
This example uses a simple sinh function based stretching. Other options can be explored in the B 101/2/3 commands to define different types of grid stretching.

Hope that helps.

PS. stretching factor of 3.0 is used purely for demonstration. In practical cases, this might be too high. You need check the aspect ratios of the grids in the DIVEMesh-Non-Uniform-Mesh.txt file and is recommended to keep the maximum cell ratios to around 1.05 or lower to ensure simulation stability.
Ok! Thanks for your reply.
YNLSW911219 is offline   Reply With Quote

Old   April 26, 2022, 11:32
Default
  #4
New Member
 
Join Date: Sep 2020
Posts: 25
Rep Power: 5
paulathikalam is on a distinguished road
Quote:
Originally Posted by kamath View Post
The commands you name are relvant if you are using a stretched grid fro your simulations.

For eg.
B 1 0.05
B 10 0.0 10.0 0.0 0.05 0.0 1.0
Will result in a two-dimensional domain that is 10 m long in the x-direction, 1 cell wide (2D) and 1 m high.
In this domain, the grid size is dx=dy=dz= 0.05 m in all directions, with a total of 4000 grids (see fig1)

On the other hand, if you want finer meshes in a part of the domain compared to the rest, you can apply a stretched mesh. For eg.

B 2 200 1 20
B 10 0.0 10.0 0.0 0.05 0.0 1.0

B 101 5
B 111 2.0
B 114 5.0

B 103 5
B 111 2.0
B 116 0.5

will create a mesh with 4000 cells but with a focus point for x-grids at x=5.0 m, and z=0.5 m. The stretching factor is 2.0. This will result in a mesh as seen in Fig 2.
The file DIVEMesh_Log/DIVEMesh-Non-Uniform-Mesh.txt will show you the max and min sizes of the grids and the location of the finest grid.
This example uses a simple sinh function based stretching. Other options can be explored in the B 101/2/3 commands to define different types of grid stretching.

Hope that helps.

PS. stretching factor of 3.0 is used purely for demonstration. In practical cases, this might be too high. You need check the aspect ratios of the grids in the DIVEMesh-Non-Uniform-Mesh.txt file and is recommended to keep the maximum cell ratios to around 1.05 or lower to ensure simulation stability.

Hii,

Is it necessary to use B 1 or B 2 in control.txt ??

I have used the following codes to generate the grid ---

############################
B 10 0.0 5.0 0.0 0.06 0.0 0.3 //domain

B 101 11 // cell based
B 127 0.0025 0.005 3.7725 0.545 1.03
B 102 11
B 128 0.0025 0.0025 0.03 0.01 1.0 // uniform grid
B 103 11
B 129 0.0025 0.005 0.15 0.14 1.03

#######################

In B 127/128/129 - we are giving min/max cell size, the refinement region and cell ratio, so this would work without B1 and B2, correct ?

Paul
paulathikalam is offline   Reply With Quote

Old   April 27, 2022, 04:24
Default
  #5
Senior Member
 
Arun Kamath
Join Date: Nov 2014
Location: Trondheim, Norway
Posts: 265
Rep Power: 13
kamath is on a distinguished road
Yes it is essential to define
B 2
in your input.

As you can see the inputs for your commands do not have an idea of what the maximum number of cells is. This is obtained from B 2.
Without this information, the stretched grids cannot be defined.
raul_xusernamex_ likes this.
__________________
Arun
X years with REEF3D
kamath is offline   Reply With Quote

Old   April 27, 2022, 04:50
Default
  #6
New Member
 
Join Date: Sep 2020
Posts: 25
Rep Power: 5
paulathikalam is on a distinguished road
Quote:
Originally Posted by kamath View Post
Yes it is essential to define
B 2
in your input.

As you can see the inputs for your commands do not have an idea of what the maximum number of cells is. This is obtained from B 2.
Without this information, the stretched grids cannot be defined.
Thank you for the clarification. I will correct my code.
paulathikalam is offline   Reply With Quote

Old   April 27, 2022, 08:23
Default
  #7
Member
 
YN
Join Date: Apr 2022
Posts: 32
Rep Power: 4
YNLSW911219 is on a distinguished road
Quote:
Originally Posted by kamath View Post
The commands you name are relvant if you are using a stretched grid fro your simulations.

For eg.
B 1 0.05
B 10 0.0 10.0 0.0 0.05 0.0 1.0
Will result in a two-dimensional domain that is 10 m long in the x-direction, 1 cell wide (2D) and 1 m high.
In this domain, the grid size is dx=dy=dz= 0.05 m in all directions, with a total of 4000 grids (see fig1)

On the other hand, if you want finer meshes in a part of the domain compared to the rest, you can apply a stretched mesh. For eg.

B 2 200 1 20
B 10 0.0 10.0 0.0 0.05 0.0 1.0

B 101 5
B 111 2.0
B 114 5.0

B 103 5
B 111 2.0
B 116 0.5

will create a mesh with 4000 cells but with a focus point for x-grids at x=5.0 m, and z=0.5 m. The stretching factor is 2.0. This will result in a mesh as seen in Fig 2.
The file DIVEMesh_Log/DIVEMesh-Non-Uniform-Mesh.txt will show you the max and min sizes of the grids and the location of the finest grid.
This example uses a simple sinh function based stretching. Other options can be explored in the B 101/2/3 commands to define different types of grid stretching.

Hope that helps.

PS. stretching factor of 3.0 is used purely for demonstration. In practical cases, this might be too high. You need check the aspect ratios of the grids in the DIVEMesh-Non-Uniform-Mesh.txt file and is recommended to keep the maximum cell ratios to around 1.05 or lower to ensure simulation stability.
Hi! I have one question.How to control the maximum cell ratios?
YNLSW911219 is offline   Reply With Quote

Old   April 27, 2022, 08:55
Default
  #8
Senior Member
 
Arun Kamath
Join Date: Nov 2014
Location: Trondheim, Norway
Posts: 265
Rep Power: 13
kamath is on a distinguished road
Depending on what you want to control, you need to select the grid generation method.
If you have a very particular mesh in mind, then simply use B 101/2/3 10 and provide files x-spacing, y-spacing, z-spacing define the grids in these directions.
The contents should range from 0 to 1 in these files.
__________________
Arun
X years with REEF3D
kamath is offline   Reply With Quote

Old   July 25, 2022, 03:16
Default Unable to generate the required geometry and fluid domain
  #9
New Member
 
Keshav Pathak
Join Date: Jul 2022
Posts: 27
Rep Power: 3
keshav_20 is on a distinguished road
Hello Arun
I am trying to create a cylinder in z-direction at location x = 17.0 and z = 0.2 and radius 0.1. However, the entire fluid domain is removed down below the cylinder. I am attaching the file below.

B 2 1000 1 10
B 10 0.0 40.0 0.0 0.04 0.0 1.0

S 32 17.0 0.2 0.1

// S 61 11.0 17.0 0.0 0.04 0.0 0.3
// S 10 17.0 19.0 0.0 0.04 0.0 0.3
// S 61 19.0 22.0 0.0 0.04 0.3 0.0

// B 101 5
// B 111 10.0
// B 114 17.0

// B 103 5
// B 113 10.0
// B 116 0.3

B 101 5
B 111 10
B 114 17.0

B 103 5
B 113 10.0
B 116 0.2

M 10 4
M 20 2
Attached Images
File Type: png Screenshot 2022-07-25 124557.png (7.8 KB, 27 views)
keshav_20 is offline   Reply With Quote

Old   September 14, 2023, 00:30
Default
  #10
New Member
 
Dimitri Sirianos
Join Date: Jul 2023
Posts: 7
Rep Power: 2
dsir99 is on a distinguished road
Quote:
Originally Posted by kamath View Post
The commands you name are relvant if you are using a stretched grid fro your simulations.

For eg.
B 1 0.05
B 10 0.0 10.0 0.0 0.05 0.0 1.0
Will result in a two-dimensional domain that is 10 m long in the x-direction, 1 cell wide (2D) and 1 m high.
In this domain, the grid size is dx=dy=dz= 0.05 m in all directions, with a total of 4000 grids (see fig1)

On the other hand, if you want finer meshes in a part of the domain compared to the rest, you can apply a stretched mesh. For eg.

B 2 200 1 20
B 10 0.0 10.0 0.0 0.05 0.0 1.0

B 101 5
B 111 2.0
B 114 5.0

B 103 5
B 111 2.0
B 116 0.5

will create a mesh with 4000 cells but with a focus point for x-grids at x=5.0 m, and z=0.5 m. The stretching factor is 2.0. This will result in a mesh as seen in Fig 2.
The file DIVEMesh_Log/DIVEMesh-Non-Uniform-Mesh.txt will show you the max and min sizes of the grids and the location of the finest grid.
This example uses a simple sinh function based stretching. Other options can be explored in the B 101/2/3 commands to define different types of grid stretching.

Hope that helps.

PS. stretching factor of 3.0 is used purely for demonstration. In practical cases, this might be too high. You need check the aspect ratios of the grids in the DIVEMesh-Non-Uniform-Mesh.txt file and is recommended to keep the maximum cell ratios to around 1.05 or lower to ensure simulation stability.
Is there a more up-to-date DiveMesh user guide that has explanations for the meaning of B 101 and the other parameters?

Can you please send a link to that user guide if it exists?
dsir99 is offline   Reply With Quote

Old   September 14, 2023, 01:35
Default
  #11
Super Moderator
 
Hans Bihs
Join Date: Jun 2009
Location: Trondheim, Norway
Posts: 377
Rep Power: 17
valgrinda is on a distinguished road
Yes, there is an explanation of the B 101 functions in the User Guide. The best way to see what they are doing is to take a simple case (e.g. the second CFD tutorial case) and try them out a bit. In general, for refinement around objects, B 101 11 gives the best result.
__________________
Hans Bihs
Team REEF3D
www.reef3d.com
valgrinda 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
User CEL Function and CFD Post chastain CFX 4 September 24, 2013 13:58
interpolation table user function not loading data properly cfdonlineuser CFX 2 November 25, 2012 19:37
Particle Transport & Termination Control with User FORTRAN Julian K. CFX 3 January 12, 2012 09:48
Check particle impaction with User Fortran Julian K. CFX 3 January 12, 2012 09:46
CFX5 and user FORTRAN Worth CFX 9 December 25, 2003 01:43


All times are GMT -4. The time now is 05:53.