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

[blockMesh] Problem with meshing a 2D wave tank

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 9, 2021, 14:01
Default Problem with meshing a 2D wave tank
  #1
New Member
 
Mateusz
Join Date: Jan 2020
Posts: 10
Rep Power: 6
Metqeu is on a distinguished road
Hello,
I am trying to create mesh using blockMesh for a 2D wave tank. This particular geometry has a beach and a simple coastal defense structure. I would like to refine the cells around the free surface at y = 0 (vertical coordinate range is from -0.5 to 0.5m).
The blockMesh directory below shows what I have done so far.
The problem with it is that it grades each block at 50% of its height, and because this geometry has variable height along the x direction, then the refinement is no longer at y = 0, but it shifts upwards (because of the sloped beach).
Is there a way to grade this mesh along a constant horizontal line?


Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.5                                   |
|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
  // back face
(0 -0.5 -0.1)             //0
(8.33 -0.5 -0.1)          //1
(16.455 -0.09375 -0.1)    //2
(16.9144 0.117 -0.1)      //3
(17.1144 0.117 -0.1)      //4
(17.378 0 -0.1)           //5
(20 0 -0.1)               //6
(20 0.5 -0.1)             //7
(17.378 0.5 -0.1)         //8
(17.1144 0.5 -0.1)        //9
(16.9144 0.5 -0.1)        //10
(16.455 0.5 -0.1)         //11
(8.33 0.5 -0.1)           //12
(0 0.5 -0.1)              //13

(0 -0.5 0.1)             //14
(8.33 -0.5 0.1)          //15
(16.455 -0.09375 0.1)    //16
(16.9144 0.117 0.1)      //17
(17.1144 0.117 0.1)      //18
(17.378 0 0.1)           //19
(20 0 0.1)               //20
(20 0.5 0.1)             //21
(17.378 0.5 0.1)         //22
(17.1144 0.5 0.1)        //23
(16.9144 0.5 0.1)        //24
(16.455 0.5 0.1)         //25
(8.33 0.5 0.1)           //26
(0 0.5 0.1)              //27
);

blocks
(
  hex (0 1 12 13 14 15 26 27) ( 740 90 1 ) simpleGrading
  (
    1
    (
      (0.5 0.5 0.33) 
      (0.5 0.5 3)    
    )
    1
  )
//2
  hex (1 2 11 12 15 16 25 26) ( 722 90 1 ) simpleGrading
  (
    1
    (
      (0.5 0.5 0.33)    
      (0.5 0.5 3)    
    )
    1
  )
//3
  hex (2 3 10 11 16 17 24 25) ( 41 90 1 ) simpleGrading
  (
    1
    (
      (0.5 0.5 0.33)    
      (0.5 0.5 3)    
    )
    1
  )
  //4
  hex (3 4 9 10 17 18 23 24) ( 18 90 1 ) simpleGrading
  (
    1
    (
      (0.5 0.5 0.33)   
      (0.5 0.5 3)    
    )
    1
  )
//5
  hex (4 5 8 9 18 19 22 23) ( 23 90 1 ) simpleGrading
  (
    1
    (
      (0.5 0.5 0.33)     
      (0.5 0.5 3)    
    )
    1
  )
//6
hex (5 6 7 8 19 20 21 22) ( 233 90 1 ) simpleGrading
(
  1
  (
    (0.5 0.5 0.33)    
    (0.5 0.5 3)    
  )
  1
)
);


edges
(
);

patches
(
    patch inlet
    (
      (27 13 0 14)
    )
    wall bottom
    (
      (14 0 1 15)
      (15 1 2 16)
      (16 2 3 17)
      (17 3 4 18)
      (18 4 5 19)
      (19 5 6 20)
    )
    patch outlet
    (
      (7 21 20 6)
    )

    patch atmosphere
    (
      (13 12 26 27)
      (12 11 25 26)
      (11 10 24 25)
      (10 9 23 24)
      (9 8 22 23)
      (8 7 21 22)
    )

    empty frontBack
    (
      (13 12 1 0)
      (12 11 2 1)
      (11 10 3 2)
      (10 9 4 3)
      (9 8 5 4)
      (8 7 6 5)
      (27 14 15 26)
      (26 15 16 25)
      (25 16 17 24)
      (24 17 18 23)
      (23 18 19 22)
      (22 19 20 21)
    )
);

mergePatchPairs
(
);

// ************************************************************************* //
Metqeu 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
Simulating numerical wave tank and calculating wave load on vertical cylinder Amit B FLUENT 0 July 27, 2019 09:56
A confusing problem at making a wave tank divoone1985 CFX 3 June 21, 2015 06:30
wave pattern problem running LTSInterFoam Alex song OpenFOAM Running, Solving & CFD 2 May 10, 2015 03:14
Problem regarding boiling in a tank rahulbr Fluent Multiphase 0 February 25, 2015 05:20
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 05:59


All times are GMT -4. The time now is 14:09.