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

[cfMesh] CfMesh Mesh Refinements

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By franjo_j
  • 1 Post By franjo_j
  • 1 Post By bennn

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 29, 2015, 16:16
Default CfMesh Mesh Refinements
  #1
New Member
 
Calum Douglas
Join Date: Apr 2013
Location: Coventry, UK
Posts: 26
Rep Power: 13
snowygrouch is on a distinguished road
Hi,
In this case we`re talking car external aero. For which I`ve basically
copied the "asmoOctree" cf-mesh standard example and adapted it to my STL geometry.

(pics attached)

I made separate STLs, car_body, ground, walls, inlet, outlet etc etc
then joined into one STL file with cat command, and in ASCII format
renamed the patches inside the single large STL.

I cant see any obvious solutions to this in the official documentation - although
I suspect that #1 is something to do with this "fms" filetype. But its not very
clear to me how I get to that from the starting point of ASCII STLs.

My questions (in decending order of importance)

1) I do not want the side and upper walls etc to have mesh refinements.
How do I stop these patches getting refined ?

(pic from cfmesh example also attached showing it how I wish my mesh to appear)

https://drive.google.com/file/d/0B7a...ew?usp=sharing

2) In snappy I can easily make an additional box shaped refinement area (inside of the outer boundary STL box) behind the car to catch the wake eddies, Can this be done in CF-Mesh too ?

https://drive.google.com/file/d/0B7a...ew?usp=sharing

3) In snappy I make alot of use of distance refinements, so I can say how far away from my car I want each level of refinement to extend. Possible in Cf ?

My cfmesh config file:

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 "car_all.stl";

maxCellSize 0.3; //0.2

boundaryCellSize 0.03;//0.025

minCellSize 0.015; //0.0125

localRefinement
{
    car_body
    {
        cellSize 0.006; //0.005
    }
    car_wheels
    {
        cellSize 0.005; //0.0025
    }
    car_tyres
    {
        cellSize 0.005; //0.025
    }
}
 
// ************************************************************************* //
Thanks for your help !

Regards
__________________
Calum Douglas
Director
Scorpion Dynamics Ltd
Email: calum.douglas@scorpion-dynamics.com
Web: www.scorpion-dynamics.com
snowygrouch is offline   Reply With Quote

Old   May 29, 2015, 19:56
Default progress
  #2
New Member
 
Calum Douglas
Join Date: Apr 2013
Location: Coventry, UK
Posts: 26
Rep Power: 13
snowygrouch is on a distinguished road
I managed to sort out most of this - not sure I`m doing in a very good way - but I solved the first one by making the boundary cell density identical to the max cell size. I think maybe not ideal but works.

The 2nd issue actually was in the manual, I just didnt look properly.

However would still be very nice to find out how to NOT get the corners of the "wind-tunnel" to have angle corner refinements added....thats the current un-solved one now (see image below).

https://drive.google.com/file/d/0B7a...ew?usp=sharing


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 "car.fms"; //"car_all.stl"

maxCellSize 0.3; //0.2

boundaryCellSize 0.3;//0.03  //make same as maxCellSize to get rid of walls being refined

minCellSize 0.015; //0.0125

localRefinement
{
    ground
    {
        cellSize 0.025; //0.005
    }
    car_body
    {
        cellSize 0.006; //0.005
    }
    car_wheels
    {
        cellSize 0.005; //0.0025
    }
    car_tyres
    {
        cellSize 0.005; //0.025
    }
}
// Next section added by Calum to refine zone behind the car -not tested yet

objectRefinements //copied from text in official manual
{
    wake_refine //zone behind car to capture wake
    {
    type		box; //shape of zone
    cellSize		0.15; //wake cell size
    centre		(3 0 1.0); // xyz centre of box
    lengthX		10.0;
    lengthY		3.5;
    lengthZ		2.0;	
    }
}

// Next section added by Calum to add in viscous layers

boundaryLayers  //coped from example "singleorifice"
{
//    nLayers 3; //viscous layers to add

//    thicknessRatio 1.2; //1.0 > 1.3

//    maxFirstLayerThickness 0.0015; //meters

    patchBoundaryLayers
    {
        "car_body"
        {
            nLayers           3;

            thicknessRatio    1.2;

            maxFirstLayerThickness 0.0015;

            allowDiscontinuity 0;
        }

    	"car_wheels"
        {
            nLayers           3;

            thicknessRatio    1.2;

            maxFirstLayerThickness 0.0015;

            allowDiscontinuity 0;
        }

    	"car_tyres"
        {
            nLayers           3;

            thicknessRatio    1.2;

            maxFirstLayerThickness 0.0015;

            allowDiscontinuity 0;
        }
    }
}

 
// ************************************************************************* //
__________________
Calum Douglas
Director
Scorpion Dynamics Ltd
Email: calum.douglas@scorpion-dynamics.com
Web: www.scorpion-dynamics.com
snowygrouch is offline   Reply With Quote

Old   June 1, 2015, 09:03
Default
  #3
Senior Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 124
Rep Power: 17
franjo_j is on a distinguished road
Send a message via Skype™ to franjo_j
Hello,

cfMesh requires only two entries in meshDict, and these are surfaceFile, and maxCellSize. All other settings are optional. Therefore, you do not need boundaryCellSize entry if you do not need to refine the mesh at the boundary.
Refinement zones near corners and edges of the bounding box very likely come from the automatic refinement procedure activated by the minCellSize setting.
It is possible to use primitives i.e. (box, sphere, cone, line) as refinement sources. The syntax is documented in the manual.
Distance refinement is available, and is activated by specifying refinementThickness. Examples are provided in the manual. It is not parallelised in the version 1.0.1, and can be slow when the thickness is large. A new improved version shall be available soon.

Kind Regards,

Franjo
elvis likes this.
__________________
Principal Developer of cfMesh and CF-MESH+
www.cfmesh.com
Social media: LinkedIn, Twitter, YouTube, Facebook, Pinterest, Instagram
franjo_j is offline   Reply With Quote

Old   March 19, 2020, 23:42
Default
  #4
New Member
 
Matheus Marques
Join Date: Mar 2020
Posts: 4
Rep Power: 6
Matheus Marques is on a distinguished road
Hello,

I'm a brazilian chemical Engineering student and actually I'm starting to use CFmesh and I saw in some CFD post that you had problema similar as mine.
I'm trying to make same refinement in each patch, but it looks like that when I use:

boundaryLayers
{
patchBoundaryLayers
{
patchName
{
nLayers 5;
thicknessRatio 1.1;
maxFirstLayerThickness 2;
}
}
}

It looks like that ALL my boundarys get the nLayers I chose for just one patch.
Do you know how can I solve this kind of problem?

The same looks like happen with

localRefinement
{
patchName1
{
cellSize 2
refinementThickness 0.5
}
patchName2
{
cellSize 0.5;
refinementThickness 0.5;
}
}

I chose one patch to have a specific cell size but the two patches get the size of the first localRefinement I did (cellSize 2).

Do you know how I can finish this problem?

Thank you!!!
Matheus Marques is offline   Reply With Quote

Old   March 20, 2020, 04:47
Default
  #5
Senior Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 124
Rep Power: 17
franjo_j is on a distinguished road
Send a message via Skype™ to franjo_j
Quote:
Originally Posted by Matheus Marques View Post
Hello,

I'm a brazilian chemical Engineering student and actually I'm starting to use CFmesh and I saw in some CFD post that you had problema similar as mine.
I'm trying to make same refinement in each patch, but it looks like that when I use:

boundaryLayers
{
patchBoundaryLayers
{
patchName
{
nLayers 5;
thicknessRatio 1.1;
maxFirstLayerThickness 2;
}
}
}

It looks like that ALL my boundarys get the nLayers I chose for just one patch.
Do you know how can I solve this kind of problem?

The same looks like happen with

localRefinement
{
patchName1
{
cellSize 2
refinementThickness 0.5
}
patchName2
{
cellSize 0.5;
refinementThickness 0.5;
}
}

I chose one patch to have a specific cell size but the two patches get the size of the first localRefinement I did (cellSize 2).

Do you know how I can finish this problem?

Thank you!!!

Check the allowDiscontinuity option. It is described in the manual.
Matheus Marques likes this.
__________________
Principal Developer of cfMesh and CF-MESH+
www.cfmesh.com
Social media: LinkedIn, Twitter, YouTube, Facebook, Pinterest, Instagram
franjo_j is offline   Reply With Quote

Old   March 20, 2020, 07:28
Default
  #6
New Member
 
Matheus Marques
Join Date: Mar 2020
Posts: 4
Rep Power: 6
Matheus Marques is on a distinguished road
Franjo, thank you to answer me!
I tried here this:
/*--------------------------------*- 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 "finalVersion.stl";

maxCellSize 5;

boundarLayers
{

patchBoundaryLayers
{
"Lateral.*"
{
nLayers 5;
thicknessRatio 1.2;
maxFirstLayerThickness 1;
allowDiscontinuity 0;
}

}
}

and after I changed allowDiscontinuity for 1 instead 0, but still does not work
I chose this patch and when I open paraView and did a slice to see the intern mesh, it looks like as anything has happend.
Matheus Marques is offline   Reply With Quote

Old   March 20, 2020, 07:44
Default
  #7
New Member
 
Matheus Marques
Join Date: Mar 2020
Posts: 4
Rep Power: 6
Matheus Marques is on a distinguished road
Now with allowDiscontinuity 1, it looks like that anything happend. I did many slice cuts in my geometry and any layer has been showed
I really don't know how to solve this!!!
Matheus Marques is offline   Reply With Quote

Old   March 27, 2020, 09:49
Default
  #8
Member
 
benoit paillard
Join Date: Mar 2010
Posts: 96
Rep Power: 16
bennn is on a distinguished road
Hi, maybe try the following :
remove maxFirstLayerThickness
add optimiseLayer
add the boundary layer on each patch one by one
Matheus Marques likes this.
bennn is offline   Reply With Quote

Reply

Tags
car, cfmesh, mesh, refinement


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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
Star CCM Overset Mesh Error (Rotating Turbine) thezack Siemens 7 October 12, 2016 12:14
[ICEM] surface mesh merging problem everest ANSYS Meshing & Geometry 44 April 14, 2016 07:41
[cfMesh] I can't create sharp edge mesh by cfMesh prodo OpenFOAM Community Contributions 5 November 11, 2015 04:42
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 22:11


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