|
[Sponsors] |
November 12, 2024, 11:36 |
blockMesh with refineMesh
|
#1 |
New Member
Join Date: Oct 2024
Posts: 9
Rep Power: 2 |
Hi foamies,
I have a simple 2D cylinder geometry in which I need some refinement only in a particular lower area. So I define a cellSet using topoSet and then refine the region recursively using refineMesh. Can someone help me resolve this bad mesh on these particular regions? This is my refineMeshDict // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // set ref; coordinateSystem global; globalCoeffs { tan1 (1 1 0); tan2 (-1 1 0); } directions ( tan1 tan2 ); useHexTopology yes; geometricCut no; writeMesh no; // ************************************************** *********************** // would snappyHexMesh give a better refinement? I did not try snappyHexMesh since I have a very simple 2D geometry Any help would be great! |
|
November 13, 2024, 12:07 |
|
#2 |
Senior Member
Join Date: Dec 2021
Posts: 251
Rep Power: 5 |
Hey!
The issue seems to be a lack of transitioning from the coarse cellsize to the fine cellsize. Since you generate a fully hexaedral mesh before refineMesh, I would give snappy a try, since it will take care of the decreasing cellsize itself. You could for instance add a searchableBox in the geometry subdictionary, then proceed to refine by a level or two in the refinementRegions subdictionary. I am not sure how good your edges will be kept though, so double check once you are done with snappy. Otherwise, you will have to use refineMesh several times to create a smooth transition zone between the coarse region and the fine region (by creating several cellzones, each slightly larger than the previous one). |
|
November 14, 2024, 04:52 |
|
#3 | |
New Member
Join Date: Oct 2024
Posts: 9
Rep Power: 2 |
Quote:
|
||
November 14, 2024, 12:12 |
|
#4 | |
New Member
Join Date: Oct 2024
Posts: 9
Rep Power: 2 |
Quote:
|
||
November 15, 2024, 05:05 |
|
#5 |
Senior Member
Join Date: Dec 2021
Posts: 251
Rep Power: 5 |
Hey!
It is probably due to some overwriting. My usual steps when meshing with snappyHexMesh are:
Are you using cellzones with setFields? Maybe snappyHexMesh is not properly configured to create those, hence setFields won't work. Can you share your case? I, or someone, will have a look when possible. |
|
November 15, 2024, 11:14 |
|
#6 | |
New Member
Join Date: Oct 2024
Posts: 9
Rep Power: 2 |
Quote:
I can share my setFields and sHM files if that is ok. And this is my procedure for reference 1. blockMesh 2. snappyHexMesh -overwrite 3. setFields 4. then run the solver. I do not create the 0.orig, instead I have alpha.air.orig and alpha.particles.orig (which I then delete) snappyHexMesh - #includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg" castellatedMesh on; snap on; addLayers on; geometry { refinementBox { type searchableBox; // Define a box for the refinement region min (-0.2 -0.2 0); // Minimum point of the box max (0.2 -0.12 0.001); // Maximum point of the box } }; castellatedMeshControls { // Settings to control maximum cell count maxLocalCells 5000000; // Max cells per processor maxGlobalCells 10000000; // Max total cells minRefinementCells 0; // Minimum cells required for refinement nCellsBetweenLevels 2; // Smoothness between refinement levels // Specify the refinement level for feature edges resolveFeatureAngle 30; // Angle for resolving sharp edges refinementSurfaces { } // Define region to be refined refinementRegions { refinementBox // Name of the box for the refinement region { mode inside; // Refine inside the box levels ((1E15 2)); // Refinement level within the box } } locationInMesh (0.0 0.0 0.0); } snapControls { // Snap settings (optional for refinement only) nSmoothPatch 3; // Patch smoothing iterations tolerance 2.0; // Tolerance for snapping nSolveIter 30; // Number of solving iterations nRelaxIter 5; // Number of relaxation iterations //explicitFeatureSnap false; //implicitFeatureSnap false; } addLayersControls { layers { } // If boundary layers are needed, define them here relativeSizes true; expansionRatio 1.2; finalLayerThickness 0.3; minThickness 0.1; nGrow 0; } meshQualityControls { // Standard mesh quality settings maxNonOrtho 65; maxBoundarySkewness 20; maxInternalSkewness 4; maxConcave 80; minFlatness 0.5; minVolRatio 0.01; minTetQuality 1e-30; minArea -1; minTwist 0.05; minDeterminant 0.001; minFaceWeight 0.05; minVolCollapseRatio 0.05; // Advanced quality settings relaxed { maxNonOrtho 75; } } writeFlags ( ); // Final settings for merging points mergeTolerance 1E-6; // ************************************************** *********************** // setFieldsDict - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // defaultFieldValues ( volScalarFieldValue alpha.air 1 volScalarFieldValue alpha.particles 0 ); regions ( boxToCell { box (-0.2 -0.2 0) (0.2 -0.17112 0.001); //7.22% fill fieldValues ( volScalarFieldValue alpha.particles 0.6 volScalarFieldValue alpha.air 0.4 ); } ); // ************************************************** *********************** // I can visualize my alpha.particles at time 0. but then they just disappear. |
||
November 15, 2024, 11:50 |
|
#7 |
Senior Member
Join Date: Dec 2021
Posts: 251
Rep Power: 5 |
I don't see any issue. If you can see your field at t=0, but it does not exist for subsequent timesteps, it probably means that it is not used/written by the solver. What solver do you use? You can maybe make a different thread and share the whole case, I do not think anyone can tell what is wrong with just what you have shared unfortunately.
|
|
November 20, 2024, 06:01 |
|
#8 | |
New Member
Join Date: Oct 2024
Posts: 9
Rep Power: 2 |
Quote:
I found a problem while looking at checkMesh. Since I have a 2D geometry to start with frontAndBack faces with empty patch, sHM is also refining in the normal direction. Do you have any ideas how to fix this? I will also search for a fix now |
||
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blockMesh] Problem with running blockMesh | yoshiyagi | OpenFOAM Meshing & Mesh Conversion | 3 | November 3, 2022 00:49 |
[mesh manipulation] BlockMesh cellSet refineMesh | mattijs | OpenFOAM Meshing & Mesh Conversion | 41 | April 7, 2020 10:32 |
[blockMesh] Multi-region Blockmesh - Refinemesh issues. | Doug68 | OpenFOAM Meshing & Mesh Conversion | 3 | February 18, 2016 21:09 |
[blockMesh] Multi-region Blockmesh - Refinemesh issues. | Doug68 | OpenFOAM Meshing & Mesh Conversion | 0 | February 17, 2016 04:39 |
[mesh manipulation] multiple calls to refineMesh parallel w/ dict failing | Regis_ | OpenFOAM Meshing & Mesh Conversion | 2 | June 4, 2015 14:44 |