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

[snappyHexMesh] checkMesh results vs layerAddition vs transient simulation

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By HPE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 22, 2019, 05:40
Default checkMesh results vs layerAddition vs transient simulation
  #1
Member
 
Piotr Ładyński
Join Date: Apr 2017
Posts: 55
Rep Power: 9
piotr.mecht is on a distinguished road
I've been learning OF for a while and I'm still struggling with meshing cad imported geometries. The snappyHexMesh fits my shape well, but somehow produces meshes, that are unusable (?) in transient simulations.

I'm trying to simulate transient hot water tank discharge in order to estimate cold inlet jet range in different dimensional configurations (buoyantPimpleFoam to account buoyancy forces with >20°C temperature differences).
The geometry seems to be quite simple, but I find it very hard to mesh it properly [Picture02]. I tried blockMesh at first [Picture03], but a huge aspect ratio between connectors and mantle diameters makes the number of blocks to increase dramatically. Requirement of consistent number of cells between blocks is also a strong limitation, so I had to use sHM.

My sHM output always finishes without any errors at faces, so it meets my meshQualityDict requirements, but checkMesh always proves it wrong, showing that there are concave cells, underdetermined cells, warped faces and so on [Picture04]. Sometimes some of these cannot be avoided, but if it happens on the surface at snapping stage it's nearly impossible to add layers without errors like negative cell volumes or warped shapes. But it happens! All the time! Especially between refinement levels, and my refinement regions just have to cut the surface.

I had this idea that it is enough to have no skewed cells and no cells with negative volume, but my simulations quickly went unstable (omega values shoot into infinity after second or third iteration, exactly on the defective cells). Reducing time step only increased Courant number, so I assumed it is definetly related to mesh quality. I ran the same simulation with different axisymmetric shape, but with the same settings and BCs to make sure my setup works okay and it did [Picture 06].

Can I leave any of these mesh checks failed? How "perfect" does my mesh need to be in order to perform such a simulation? I can't prepare a single working solution, so how i'm supposed to check my grid convergence?

I think I slightly understand what these check errors mean (as they easily can be displayed in Paraview), but i have no clue how to avoid them. Is there any explaination or general tips for this?
It doesn't seem to be that hard, but it is really ashaming to say for how long I'm trying to solve this problem :< Where am I failing at?
piotr.mecht is offline   Reply With Quote

Old   September 22, 2019, 08:19
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
Is there any chance to isolate the issues, if possible? It may account for many interconnected issues, and other users can easily shy away from the thread:

How to give enough info to get help

How to create a Minimal, Reproducible Example
HPE is offline   Reply With Quote

Old   September 22, 2019, 10:16
Default
  #3
Member
 
Piotr Ładyński
Join Date: Apr 2017
Posts: 55
Rep Power: 9
piotr.mecht is on a distinguished road
Quote:
Originally Posted by HPE View Post
Is there any chance to isolate the issues, if possible? It may account for many interconnected issues, and other users can easily shy away from the thread

What do you suggest? Is it better to:

Post 3 separate threads?
Specify my problem better?
Rename this thread?
Post more files?


Short attempt on clarification:
============================
BACKGROUND
  • transient buoyant flow with huge flow diameters aspect ratio, that acts highly unstable



HISTORY
  • did my best exclude non-mesh factors, like poorly chosen boundary conditons by making example that works
  • did dozens of snappyHexMesh/blockmesh tweaks/changes, but the best results have similiar defects



SYMPTOMS
  • snappyHexMesh snapping stage result matches my geometry and mesh faces meet my meshQualityDict requirements

Code:
Checking final mesh ...
Checking faces in error :
    non-orthogonality > 65  degrees                        : 0
    faces with face pyramid volume < 1e-13                 : 0
    faces with face-decomposition tet quality < 1e-05      : 0
    faces with concavity > 45  degrees                     : 0
    faces with skewness > 4   (internal) or 20  (boundary) : 0
    faces with interpolation weights (0..1)  < 0.05        : 0
    faces with volume ratio of neighbour cells < 0.01      : 0
    faces with face twist < 0.02                           : 0
    faces on cells with determinant < 0.001                : 0
Finished meshing without any errors
Finished meshing in = 146.18 s.
End
  • results of checkMesh -allGeometry -allTopology is always similiar to:

Code:
Checking geometry...
    Overall domain bounding box (-4.284234e-05 0 -0.05499932) (0.52 0.2249869 1.055)
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
    Mesh has 3 solution (non-empty) directions (1 1 1)
    Boundary openness (8.426583e-18 9.997333e-16 -3.762991e-17) OK.
    Max cell openness = 2.764813e-16 OK.
    Max aspect ratio = 8.3008 OK.
    Minimum face area = 3.255282e-08. Maximum face area = 0.0002182453.  Face area magnitudes OK.
    Min volume = 8.974106e-11. Max volume = 3.513329e-06.  Total volume = 0.08343245.  Cell volumes OK.
    Mesh non-orthogonality Max: 53.44792 average: 4.47215
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 2.402908 OK.
    Coupled point location match (average 0) OK.
    Face tets OK.
    Min/max edge length = 0.0003092145 0.0153202 OK.
   *There are 379 faces with concave angles between consecutive edges. Max concave angle = 32.91622 degrees.
  <<Writing 379 faces with concave angles to set concaveFaces
    Face flatness (1 = flat, 0 = butterfly) : min = 0.7991233  average = 0.9996546
   *There are 2 faces with ratio between projected and actual area < 0.8
    Minimum ratio (minimum flatness, maximum warpage) = 0.7991233
  <<Writing 2 warped faces to set warpedFaces
    Cell determinant (wellposedness) : minimum: 2.168404e-19 average: 1.290607
 ***Cells with small determinant (< 0.001) found, number of cells: 2
  <<Writing 2 under-determined cells to set underdeterminedCells
 ***Concave cells (using face planes) found, number of cells: 63
  <<Writing 63 concave cells to set concaveCells
    Face interpolation weight : minimum: 0.06002608 average: 0.4821363
    Face interpolation weight check OK.
    Face volume ratio : minimum: 0.01420995 average: 0.9177641
    Face volume ratio check OK.

Failed 2 mesh checks.
These bad cells are on the boundary and they cause bad faces/cells after adding layers in these cells/faces



PROBLEM (ok... 2 problems)

  • Are there any rules of thumb to avoid these problematic cells?
  • Does my mesh really need to be that sterile or am I doing something wrong?











-
piotr.mecht is offline   Reply With Quote

Old   September 22, 2019, 13:29
Default
  #4
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
Quote:
Originally Posted by piotr.mecht View Post
What do you suggest? Is it better to:

Post 3 separate threads?
Specify my problem better?
Rename this thread?
Post more files?


Short attempt on clarification:
============================
BACKGROUND
  • transient buoyant flow with huge flow diameters aspect ratio, that acts highly unstable



HISTORY
  • did my best exclude non-mesh factors, like poorly chosen boundary conditons by making example that works
  • did dozens of snappyHexMesh/blockmesh tweaks/changes, but the best results have similiar defects



SYMPTOMS
  • snappyHexMesh snapping stage result matches my geometry and mesh faces meet my meshQualityDict requirements

Code:
Checking final mesh ...
Checking faces in error :
    non-orthogonality > 65  degrees                        : 0
    faces with face pyramid volume < 1e-13                 : 0
    faces with face-decomposition tet quality < 1e-05      : 0
    faces with concavity > 45  degrees                     : 0
    faces with skewness > 4   (internal) or 20  (boundary) : 0
    faces with interpolation weights (0..1)  < 0.05        : 0
    faces with volume ratio of neighbour cells < 0.01      : 0
    faces with face twist < 0.02                           : 0
    faces on cells with determinant < 0.001                : 0
Finished meshing without any errors
Finished meshing in = 146.18 s.
End
  • results of checkMesh -allGeometry -allTopology is always similiar to:

Code:
Checking geometry...
    Overall domain bounding box (-4.284234e-05 0 -0.05499932) (0.52 0.2249869 1.055)
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
    Mesh has 3 solution (non-empty) directions (1 1 1)
    Boundary openness (8.426583e-18 9.997333e-16 -3.762991e-17) OK.
    Max cell openness = 2.764813e-16 OK.
    Max aspect ratio = 8.3008 OK.
    Minimum face area = 3.255282e-08. Maximum face area = 0.0002182453.  Face area magnitudes OK.
    Min volume = 8.974106e-11. Max volume = 3.513329e-06.  Total volume = 0.08343245.  Cell volumes OK.
    Mesh non-orthogonality Max: 53.44792 average: 4.47215
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 2.402908 OK.
    Coupled point location match (average 0) OK.
    Face tets OK.
    Min/max edge length = 0.0003092145 0.0153202 OK.
   *There are 379 faces with concave angles between consecutive edges. Max concave angle = 32.91622 degrees.
  <<Writing 379 faces with concave angles to set concaveFaces
    Face flatness (1 = flat, 0 = butterfly) : min = 0.7991233  average = 0.9996546
   *There are 2 faces with ratio between projected and actual area < 0.8
    Minimum ratio (minimum flatness, maximum warpage) = 0.7991233
  <<Writing 2 warped faces to set warpedFaces
    Cell determinant (wellposedness) : minimum: 2.168404e-19 average: 1.290607
 ***Cells with small determinant (< 0.001) found, number of cells: 2
  <<Writing 2 under-determined cells to set underdeterminedCells
 ***Concave cells (using face planes) found, number of cells: 63
  <<Writing 63 concave cells to set concaveCells
    Face interpolation weight : minimum: 0.06002608 average: 0.4821363
    Face interpolation weight check OK.
    Face volume ratio : minimum: 0.01420995 average: 0.9177641
    Face volume ratio check OK.

Failed 2 mesh checks.
These bad cells are on the boundary and they cause bad faces/cells after adding layers in these cells/faces



PROBLEM (ok... 2 problems)

  • Are there any rules of thumb to avoid these problematic cells?
  • Does my mesh really need to be that sterile or am I doing something wrong?











-
In view of checkMesh output, I do not think your mesh is problematic. For example, you can ignore concave* warnings.

Have a look at the previous forum threads in elaborating the mesh metrics that you think problematic.

IMHO, very likely, something should be wrong with the remaining set of settings.
piotr.mecht likes this.
HPE is offline   Reply With Quote

Old   September 22, 2019, 16:05
Default
  #5
Member
 
Piotr Ładyński
Join Date: Apr 2017
Posts: 55
Rep Power: 9
piotr.mecht is on a distinguished road
Quote:
Originally Posted by HPE View Post
In view of checkMesh output, I do not think your mesh is problematic. For example, you can ignore concave* warnings.

Have a look at the previous forum threads in elaborating the mesh metrics that you think problematic.

IMHO, very likely, something should be wrong with the remaining set of settings.
Thank you for this reply, it looks helpful. I'll follow your advice.
piotr.mecht is offline   Reply With Quote

Old   October 13, 2019, 07:02
Default
  #6
Member
 
Piotr Ładyński
Join Date: Apr 2017
Posts: 55
Rep Power: 9
piotr.mecht is on a distinguished road
Some 'not-perfect' cells produced extreme omega values, but it didn't affect solver stability much. Flow was unstable even with the turbulence equation disabled.



I've solved my problem a while ago, and the true reason of the high instability was a missing non-default entry in thermophysicalProperties
Code:
dpdt off;
It comes from the pressure-work term in energy equation, which wasn't relevant in this this case. In case of liquid water the pressure changes weren't involved in changes of energy balance at measurable rate:
https://caefn.com/openfoam/solvers-buoyantpimplefoam


It worked well with dpdt on in hotRoom or circuitBoardCooling tutorials which used perfectGas in equationOfState field.
piotr.mecht is offline   Reply With Quote

Reply

Tags
checkmesh, mesh qualty, underdetermined cells


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
Transient Simulation in CFX ashtonJ CFX 1 September 28, 2018 01:18
Convergence Problem - Transient Simulation gemxx Main CFD Forum 0 July 15, 2018 09:36
Simulation FPEs - turbulence for transient and steady-state? DaveR OpenFOAM Running, Solving & CFD 5 March 5, 2017 15:06
restarting paused transient simulation using reactingFoam JMDag2004 OpenFOAM Running, Solving & CFD 1 August 10, 2015 10:15
Exporting data of transient simulation DURING a simulation, at user locations ? Milan2013 CFX 0 April 18, 2014 03:47


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