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

[Other] Multilevels Refinement with cfMesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 4, 2018, 05:50
Default Multilevels Refinement with cfMesh
  #1
New Member
 
Rémy CAVECCHIA
Join Date: Sep 2018
Location: Nevers, FRANCE
Posts: 4
Rep Power: 7
RemyCavecchia is on a distinguished road
Hi,

I'm currently trying to switch from sHM to cfMesh for my case study and I was wondering if there is a way to set multilevels refinement as you can do it in sHM.

For my case study, I'm trying to mesh around a "foil" which is randomly generated and for this purpose I can't be satisfied with using only objectsRefinement and I want to use localRefinement close to my item surface.

I achieve this with no problems but I'm used to set multilevels refinement according to different surface distance in sHM and I can't find a way to do the same thing here.

Here is my first attempt with only one level:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                |
| \\      /  F ield         | cfMesh: A library for mesh generation          |
|  \\    /   O peration     |                                                |
|   \\  /    A nd           | Author: Franjo Juretic                         |
|    \\/     M anipulation  | E-mail: franjo.juretic@c-fields.com            |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version   2.0;
    format    ascii;
    class     dictionary;
    location  "system";
    object    meshDict;
}

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

surfaceFile "airfoil.fms";

minCellSize 0.125;

maxCellSize 0.125; 

boundaryCellSize 0.125;

localRefinement
{
	"airfoil"
	{
	cellSize 7.8125e-3;
	refinementThickness 0.05;
	}
}

objectRefinements
{
	box1
	{
	type		box;
	cellSize	0.03125;
	centre		(1 0 0.005);
	lengthX 	3;
	lengthY		1.2;
	lengthZ 	0.01;
	}

	box2
	{
	type		box;
	cellSize	0.0625;
	centre		(2.7 0 0.005);
	lengthX		6.6;
	lengthY		1.4;
	lengthZ		0.01;
	}

	box3
	{
	type 		box;
	cellSize	0.125;
	centre		(11 0 0.005);
	lengthX		10;
	lengthY		1.4;
	lengthZ		0.01;
	}
}

boundaryLayers
{
//    nLayers 3;

//    thicknessRatio 1.2;

//    maxFirstLayerThickness 0.5;

    patchBoundaryLayers
    {
        "airfoil"
        {
            nLayers           10;

            thicknessRatio    1.2;

            maxFirstLayerThickness 0.2;

            allowDiscontinuity 0;
        }
   }
}

renameBoundary
{
    newPatchNames
    {
        "airfoil"
        {
            type    wall;
            newName airfoil;
        }
    }
}


// ************************************************************************* //
And here is the result:


And then I tried, as I didn't find any other way to add another localRefinement on the same patch:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                |
| \\      /  F ield         | cfMesh: A library for mesh generation          |
|  \\    /   O peration     |                                                |
|   \\  /    A nd           | Author: Franjo Juretic                         |
|    \\/     M anipulation  | E-mail: franjo.juretic@c-fields.com            |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version   2.0;
    format    ascii;
    class     dictionary;
    location  "system";
    object    meshDict;
}

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

surfaceFile "airfoil.fms";

minCellSize 0.125;

maxCellSize 0.125; 

boundaryCellSize 0.125;

localRefinement
{
	"airfoil"
	{
	cellSize 7.8125e-3;
	refinementThickness 0.05;
	}
	"airfoil"
	{
	cellSize 1.5625e-2;
	refinementThickness 0.2;
	}
}

objectRefinements
{
	box1
	{
	type		box;
	cellSize	0.03125;
	centre		(1 0 0.005);
	lengthX 	3;
	lengthY		1.2;
	lengthZ 	0.01;
	}

	box2
	{
	type		box;
	cellSize	0.0625;
	centre		(2.7 0 0.005);
	lengthX		6.6;
	lengthY		1.4;
	lengthZ		0.01;
	}

	box3
	{
	type 		box;
	cellSize	0.125;
	centre		(11 0 0.005);
	lengthX		10;
	lengthY		1.4;
	lengthZ		0.01;
	}
}

boundaryLayers
{
//    nLayers 3;

//    thicknessRatio 1.2;

//    maxFirstLayerThickness 0.5;

    patchBoundaryLayers
    {
        "airfoil"
        {
            nLayers           10;

            thicknessRatio    1.2;

            maxFirstLayerThickness 0.2;

            allowDiscontinuity 0;
        }
   }
}

renameBoundary
{
    newPatchNames
    {
        "airfoil"
        {
            type    wall;
            newName airfoil;
        }
    }
}


// ************************************************************************* //
But it only took into account the last refinement:


Does anyone has any idea how can this be solved??

Thanks.

Remy.
RemyCavecchia is offline   Reply With Quote

Old   September 18, 2018, 16:58
Default
  #2
New Member
 
FredPieri
Join Date: Mar 2018
Posts: 16
Rep Power: 8
Fredvol is on a distinguished road
Hi ,
I 'am also interested to get the answer to how define multi-refinementThickness on the same object.


What i'am currently doing is to declare several primitive ( box, sphere) and use one "refinementThickness" on each.



But please note that according to this post:
https://www.cfd-online.com/Forums/op...ease-read.html
,I think it is better to post your question there (use the prefix CfMesh):
https://www.cfd-online.com/Forums/op...contributions/


cheers
fred
Fredvol is offline   Reply With Quote

Old   September 18, 2018, 17:08
Default
  #3
New Member
 
Rémy CAVECCHIA
Join Date: Sep 2018
Location: Nevers, FRANCE
Posts: 4
Rep Power: 7
RemyCavecchia is on a distinguished road
Hi Fred,

That's what I did also but not very efficient as the shape is generated randomly in my case.

Thanks for the advice, I didn't notice that there was a dedicated place for cfmesh. I'll correct that quickly.

Cheers.

Remy
RemyCavecchia 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] SnappyHexMesh running killed! Mark JIN OpenFOAM Meshing & Mesh Conversion 7 June 14, 2022 01:37
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops avinashjagdale OpenFOAM Meshing & Mesh Conversion 53 March 8, 2019 09:42
[snappyHexMesh] Edge Refinement fracasce OpenFOAM Meshing & Mesh Conversion 3 December 2, 2017 13:30
killed "snappyHexMesh" parkh32 OpenFOAM Pre-Processing 2 April 8, 2012 17:12
[snappyHexMesh] snappyHexMesh aborting Tobi OpenFOAM Meshing & Mesh Conversion 0 November 10, 2010 03:23


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