CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: snappyHexMesh and Others

CfMesh Mesh Refinements

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

Like Tree1Likes
  • 1 Post By franjo_j

Reply
 
LinkBack Thread Tools Display Modes
Old   May 29, 2015, 15:16
Default CfMesh Mesh Refinements
  #1
New Member
 
Calum Douglas
Join Date: Apr 2013
Location: Coventry, UK
Posts: 18
Rep Power: 6
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, 18:56
Default progress
  #2
New Member
 
Calum Douglas
Join Date: Apr 2013
Location: Coventry, UK
Posts: 18
Rep Power: 6
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, 08:03
Default
  #3
Senior Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 118
Rep Power: 9
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
www.cfmesh.com
Social media: LinkedIn, Twitter, YouTube, Google+, Facebook, Pinterest
franjo_j is offline   Reply With Quote

Reply

Tags
car, cfmesh, mesh, refinement

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
[ICEM] surface mesh merging problem everest ANSYS Meshing & Geometry 44 April 14, 2016 06:41
sliding mesh problem in CFX Saima CFX 45 September 22, 2015 10:53
Propeller mesh not smooth nortanapura OpenFOAM Native Meshers: snappyHexMesh and Others 0 May 16, 2014 03:26
snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Native Meshers: snappyHexMesh and Others 2 March 27, 2011 21:11
basic of mesh refinement arya CFX 4 June 19, 2007 12:21


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