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

[Other] Add / remove cell layers (dynamic mesh)

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ChristophGradl

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 10, 2014, 02:44
Default Add / remove cell layers (dynamic mesh)
  #1
New Member
 
Christoph Gradl
Join Date: Feb 2014
Posts: 18
Rep Power: 12
ChristophGradl is on a distinguished road
Hello!
I am a beginner in OpenFoam and would be very glad to get some additional information for my questions.

I am studying dynamic mesh moving in OpenFoam. I want to add / remove mesh layers instead of changing the mesh size. I studied the movingConeTopo tutorial, but I am working with OpenFoam v.2.2, the tutorial was created with version 1.5.

Can somebody send me a tutorial case for add / remove cell layers or give me an idea of what the case should look like.

I tried:
1) set up a mesh with blockMesh
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.2                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 0.1;
vertices
(
    (0 0 0)
    (1 0 0)
    (1 1 0)
    (0 1 0)
    (0 0 0.1)
    (1 0 0.1)
    (1 1 0.1)
    (0 1 0.1)
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (50 50 1) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    movingWall
    {
        type wall;
        faces
        (
            (2 6 5 1) // right
        ); 
    }
    fixedWalls
    {
        type wall;
        faces
        (
            (1 5 4 0) // bottom 
            (3 7 6 2) //top
        );
    }
    inlet
    {
        type wall;
        faces
        (
        (0 4 7 3) // left
        );
    }

    frontAndBack
    {
        type empty;
        faces
        (
            (0 3 2 1)
            (4 5 6 7)
        );
    }
);

mergePatchPairs
(
);

// ************************************************************************* //
2) dynamicMeshDict
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM Extend Project: Open Source CFD        |
|  \\    /   O peration     | Version:  1.6-ext                               |
|   \\  /    A nd           | Web:      www.extend-project.de                 |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
motionSolverLibs ( "libfvMotionSolvers.so" );
dynamicFvMesh   movingConeTopoFvMesh;

movingConeTopoFvMeshCoeffs
{
motionVelAmplitude (-1 0.0 0);
motionVelPeriod 1e-6;

leftEdge 0;
leftObstacleEdge 0;
rightObstacleEdge 0.1;

left
{
minThickness 1e-4;
maxThickness 1e-3;
}

right
{
minThickness 1e-4;
maxThickness 1e-3;
}
}
// ************************************************************************* //
3) meshModifiers
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.2                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      meshModifiers;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

1
(
right
{
type layerAdditionRemoval;
faceZoneName mWallSet;
minLayerThickness 0.00002;
maxLayerThickness 0.00005;
oldLayerThickness 0;
active true;
}


left
{
type layerAdditionRemoval;
faceZoneName minletSet;
minLayerThickness 0.00002;
maxLayerThickness 0.00005;
oldLayerThickness 0;
active false;
}
)

// ************************************************************************* //
4) the faceZone are created with topoSet (topoSetDict)
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.2                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      topoSetDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(
    // Heater
    {
        name    heater;
        type    cellSet;
        action  new;
        source  boxToCell;
        sourceInfo
        {
            box (0 0 0)(0.1 0.1 0.01);
        }
    }
    {
        name    heater1;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set heater;           // name of cellSet
        }
    }
    {
        name    mWall;
        type    faceSet;
        action  new;
        source  patchToFace;
        sourceInfo
        {
            name "movingWall";
        }
    }
    {
        name    mWall;
        type    faceSet;
        action  add;
        source  cellToFace;
        sourceInfo
        {
            set heater; 
            option all; 
        }
    }
    {
        name    mWallSet;
        type    faceZoneSet;
        action  new;
        source  setToFaceZone;
        sourceInfo
        {
            faceSet mWall;
        }
    }
    
        {
        name    minlet;
        type    faceSet;
        action  new;
        source  patchToFace;
        sourceInfo
        {
            name "inlet";
        }
    }
    {
        name    minletSet;
        type    faceZoneSet;
        action  new;
        source  setToFaceZone;
        sourceInfo
        {
            faceSet minlet;
        }
    }

);

// ************************************************************************* //
I get an error, if i run my test case with pimpleDyMFoam

Code:
Create mesh for time = 0

Selecting dynamicFvMesh movingConeTopoFvMesh
Initial time:0 Initial curMotionVel_:(-0 0 0)
void movingConeTopoFvMesh::addZonesAndModifiers() : Zones and modifiers already present.  Skipping.
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigSegv::sigHandler(int) at ??:?
#2   in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::faceZone::operator()() const at ??:?
#4  Foam::movingConeTopoFvMesh::movingConeTopoFvMesh(Foam::IOobject const&) at ??:?
#5  Foam::dynamicFvMesh::addIOobjectConstructorToTable<Foam::movingConeTopoFvMesh>::New(Foam::IOobject const&) at ??:?
#6  Foam::dynamicFvMesh::New(Foam::IOobject const&) at ??:?
#7  
 at ??:?
#8  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#9  
 at ??:?
Segmentation fault (core dumped)
Where can I find informations about add / remove celllayers in version 2.2? Maybe a tutorial case?

Best regards,
Christoph
jaimeff likes this.
ChristophGradl is offline   Reply With Quote

Old   June 2, 2014, 08:28
Default movingConeTopo tutorial
  #2
New Member
 
Frank Whittle
Join Date: Aug 2010
Posts: 12
Rep Power: 16
challenger is on a distinguished road
Hi Christoph,

I've currently started looking into this topic as well. I would like to know if you've managed to get anything out of it.

From what I've seen, the moving topo libraries have been marked redundant since 1.6 or 1.7 version and I did find a post from Prof. Jasak mentioniong the addLayer classes need to be implemented into whatever solver you're working on.

For the moment I cannot even seem to find the movingConeTopo tutorial, I would really appreciate it if you could post the tutorial with layer addition

Thanks.
challenger is offline   Reply With Quote

Old   June 2, 2014, 10:36
Default
  #3
New Member
 
Christoph Gradl
Join Date: Feb 2014
Posts: 18
Rep Power: 12
ChristophGradl is on a distinguished road
Hi!
You might want to check out foam-extend-3.0 (http://www.extend-project.de/the-extend-project) . In foam-extend the movingConeTopo tutorial can be found. It works only in foam-extend, maybe you can port it to OF 2.3.0.

The version of the library can be adapt to different setups by using the setSet command.

When I have time, I want to try to implement the library in OF 2.3. Maybe we can stay in contact and exchange our results.

Best regards,
Christoph
ChristophGradl is offline   Reply With Quote

Old   June 16, 2014, 08:23
Default
  #4
New Member
 
Frank Whittle
Join Date: Aug 2010
Posts: 12
Rep Power: 16
challenger is on a distinguished road
Hi Christoph,

Thanks for the reply and sorry I could couldn't get back to you earlier.

I got Extends 3.0 installed and looked at the tutorial, finally. I am not sure where I'm heading with this because I'm trying to test out injection modelling and I might have to scrap the project if I don't progress within the next few weeks, otherwise I would also be interested in importing this to OpenFOAM 2+

I've attached an image from the tutorial I am working on, I'll try to post the tutorial when I have the computer with me. I'm trying to move the empty space from right to left, adding layers along the red line. This is supposed to signify an injector nozzle. The layer addition seems to work in a rectangular surface when the two thin mesh layers are defined as moving zones but not if I want it described as in the picutre with zone 1 moving and zone two being fixed, the patch between the two zones being my layer addition patch.

Do you have any idea for this? Do you know if sliding interface can be combined with layer addition?

Thanks, Ishan

(P.S. used a fake name because of company policy while doing my thesis, and I cannot find the option to change it back )
Attached Images
File Type: jpg Injection.jpg (57.3 KB, 322 views)
challenger is offline   Reply With Quote

Old   June 20, 2014, 10:44
Default
  #5
New Member
 
Frank Whittle
Join Date: Aug 2010
Posts: 12
Rep Power: 16
challenger is on a distinguished road
basicWorking is movingConeTopo except for slight geometry modification.

fixedZone is the same as above where I have separated the movingZone into two parts. One that moves and one that is fixed, the moving layer is between these two sets and I would ideally like to produce the dynamic cell layer addition here.

sample2Dcase is my actual 2D example, where the solid body needs to move away from the cylinder side while introducing dynamic cell layer addition.

Is this even possible?

(All of these were created with OpenFOAM extends project 3.0)
Attached Files
File Type: gz basicWorking.tar.gz (4.4 KB, 127 views)
File Type: gz fixedZone.tar.gz (4.4 KB, 85 views)
File Type: gz sample2Dcase.tar.gz (4.7 KB, 106 views)
challenger is offline   Reply With Quote

Old   November 5, 2014, 14:33
Default
  #6
New Member
 
Caro
Join Date: Jul 2014
Posts: 15
Rep Power: 12
will_ca is on a distinguished road
Hi,
did you manage to do the cell layer addition? I'm trying to do something similar. Could you share how you did it?
will_ca is offline   Reply With Quote

Old   December 11, 2014, 06:26
Default
  #7
New Member
 
Frank Whittle
Join Date: Aug 2010
Posts: 12
Rep Power: 16
challenger is on a distinguished road
Unfortunately I couldn't go further than that.
challenger is offline   Reply With Quote

Old   September 7, 2017, 13:03
Default
  #8
New Member
 
Jue Wang
Join Date: Apr 2014
Posts: 23
Rep Power: 12
Joe Wang is on a distinguished road
Hi, Frank,
Hope you have figured it out. I have the same problem as you faced. Could you share a case as a tutorial if you have figured it out? Thank you.
Joe
Quote:
Originally Posted by challenger View Post
Unfortunately I couldn't go further than that.
Joe Wang is offline   Reply With Quote

Old   September 7, 2017, 15:27
Default
  #9
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
For movingCone, you should have a look at the source code for it in src/topoChangerFvMesh/movingConeTopoFvMesh/movingConeTopoFvMesh.C

This moving mesh class is very specific and requires that the faces you want to remove/add lie in a specific x plane, and that you are only moving in the x plane. If you want to do custom layerAR, you will need to make your on mesh class.
mturcios777 is offline   Reply With Quote

Old   April 8, 2021, 05:08
Default Add/ remove cell layers
  #10
Member
 
Michael Sukham
Join Date: Mar 2020
Location: India
Posts: 85
Rep Power: 6
2538sukham is on a distinguished road
Now I found that the moving cell is actually as it is and it is only that the cell in front will be added or deleted according to the min and max thickness provided in the dynamicMeshDict. Is there any other way to deform the moving cell as well? Since the movingcell is a part of the computational domain, wont it affect the solution?
2538sukham 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
[snappyHexMesh] Add Mesh Layers doesnt work on the whole surface Kryo OpenFOAM Meshing & Mesh Conversion 13 February 17, 2022 08:34
[snappyHexMesh] Help with Snappy: no layers growing GianF OpenFOAM Meshing & Mesh Conversion 2 September 23, 2020 09:26
[snappyHexMesh] Creating multiple multiple cell zones with snappyHexMesh - a newbie in deep water! divergence OpenFOAM Meshing & Mesh Conversion 0 January 23, 2019 05:17
How to use "translation" in solidBodyMotionFunction in OpenFOAM rupesh_w OpenFOAM Running, Solving & CFD 5 August 16, 2016 05:27
dynamic mesh + inflation layers Albino FLUENT 3 May 15, 2014 14:59


All times are GMT -4. The time now is 07:56.