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

Add / remove cell layers (dynamic mesh)

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

Reply
 
LinkBack Thread Tools 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: 8
Rep Power: 4
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
ChristophGradl is offline   Reply With Quote

Old   June 2, 2014, 07:28
Default movingConeTopo tutorial
  #2
New Member
 
Frank Whittle
Join Date: Aug 2010
Posts: 12
Rep Power: 8
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, 09:36
Default
  #3
New Member
 
Christoph Gradl
Join Date: Feb 2014
Posts: 8
Rep Power: 4
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, 07:23
Default
  #4
New Member
 
Frank Whittle
Join Date: Aug 2010
Posts: 12
Rep Power: 8
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, 133 views)
challenger is offline   Reply With Quote

Old   June 20, 2014, 09:44
Default
  #5
New Member
 
Frank Whittle
Join Date: Aug 2010
Posts: 12
Rep Power: 8
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, 66 views)
File Type: gz fixedZone.tar.gz (4.4 KB, 43 views)
File Type: gz sample2Dcase.tar.gz (4.7 KB, 50 views)
challenger is offline   Reply With Quote

Old   November 5, 2014, 14:33
Default
  #6
New Member
 
Caro
Join Date: Jul 2014
Posts: 12
Rep Power: 4
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: 8
challenger is on a distinguished road
Unfortunately I couldn't go further than that.
challenger is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
pyFoam and paraview eelcovv OpenFOAM Paraview & paraFoam 28 May 30, 2016 09:23
Adding layers goes wrong with SnappyHexMesh Elise OpenFOAM Native Meshers: snappyHexMesh and Others 1 April 22, 2013 02:32
Add Mesh Layers doesnt work on the whole surface Kryo OpenFOAM Native Meshers: snappyHexMesh and Others 8 September 13, 2012 09:28
Effect of adding layers with sHM Nucleophobe OpenFOAM Native Meshers: snappyHexMesh and Others 4 August 20, 2012 16:45
Warning 097- AB CD-adapco 6 November 15, 2004 05:41


All times are GMT -4. The time now is 10:42.