CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Does dynamicRefineFvMesh work with unstructured tetra meshes?

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 22, 2017, 12:34
Default Does dynamicRefineFvMesh work with unstructured tetra meshes?
  #1
Member
 
Giovanni Medici
Join Date: Mar 2014
Posts: 45
Rep Power: 12
giovanni.medici is on a distinguished road
Dear All,

I'm running a test case with sonicDyMFoam solver of supersonic external aerodynamics.
The simple test case is basically a coarse mesh of an half sphere in half (far-field cylinder). The mesh is unstructured tetra.

I slightly modify the solver to save grad(p) and then what I'm trying (unsucessfully) to achieve is mesh refinement when high pressure gradients are encountered (so to better capture shockwaves).

The "patched" solver compiled successfully, and saves, as expected, the PGrad variable.

I added a dynamicMeshDict file (below) in the constant/ folder, but when the case runs, in the log reports that no cell is currently selected to be refined/unrefined.

dynamicMeshDict:

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //



dynamicFvMesh dynamicRefineFvMesh;
   dynamicRefineFvMeshCoeffs
   {
       refineInterval 100;
       field PGrad;
       lowerRefineLevel   1e4;
       upperRefineLevel   1e6; 
       unrefineLevel 2;
       nBufferLayers 4;
       maxRefinement 4;
       maxCells 2000000;
       correctFluxes (( phi U ));
       dumpLevel true;
   }


Representative part of the log file:
Code:
Courant Number mean: 0.00366043 max: 0.273355
Time = 1e-05

Selected 0 cells for refinement out of 77833.
Selected 0 split points out of a possible 0.
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
rhoEqn max/min : 0.035079 0.00980862
PIMPLE: iteration 1
DILUPBiCGStab:  Solving for Ux, Initial residual = 5.45536e-05, Final residual = 2.39771e-11, No Iterations 2
DILUPBiCGStab:  Solving for Uy, Initial residual = 0.000384717, Final residual = 1.37344e-10, No Iterations 2
DILUPBiCGStab:  Solving for Uz, Initial residual = 0.0026547, Final residual = 5.29768e-10, No Iterations 2
DILUPBiCGStab:  Solving for e, Initial residual = 0.000205737, Final residual = 1.21308e-10, No Iterations 2
DILUPBiCGStab:  Solving for p, Initial residual = 0.000450696, Final residual = 6.1073e-14, No Iterations 3
DILUPBiCGStab:  Solving for p, Initial residual = 3.89561e-06, Final residual = 1.02284e-13, No Iterations 2
DILUPBiCGStab:  Solving for p, Initial residual = 1.06994e-06, Final residual = 3.20422e-14, No Iterations 2
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 1.0582e-15, global = 6.10016e-16, cumulative = 7.44534e-15
DILUPBiCGStab:  Solving for p, Initial residual = 6.35212e-07, Final residual = 2.41879e-14, No Iterations 2
DILUPBiCGStab:  Solving for p, Initial residual = 3.89155e-07, Final residual = 7.95415e-13, No Iterations 2
DILUPBiCGStab:  Solving for p, Initial residual = 2.84734e-07, Final residual = 6.14724e-13, No Iterations 2
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 1.23169e-15, global = 4.35367e-16, cumulative = 7.88071e-15
ExecutionTime = 1.58 s  ClockTime = 2 s

Is there any limitation to tetra meshes, or am I missing some relevant file in 0/ or system/ folders?

Sorry, it is probably quite straightforward, but I went through the openfoam wiki, obviously this great forum, but apparently I'm missing something, and can't figure it out...

I tried various combinations of parameters (lowerRefineLevel / upperRefineLevel) and also more conventional fields (p T), as well as serial and parallel runs, but none worked successfully.

Thanks, any help is appreciated.

I'm using openFOAMv1612.
giovanni.medici is offline   Reply With Quote

Old   August 22, 2017, 15:00
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

the dynamicRefine library works with the hexRef8 library. As you can imagine, it is only possible for hexaeder. After starting the solver you should get a new file named protectedCells or something like that in the constant/polyMesh folder. There you will find the cells that are excluded from the refinement. In your particular case I guess all cells are inside. As far as I know, SimScale has a library which works for tetraeder meshes but out of the box I don't know a standard library in foam which handles that. At least not in the refinement library.

To solve it, you have to make your own library.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   August 23, 2017, 02:35
Default
  #3
Member
 
Giovanni Medici
Join Date: Mar 2014
Posts: 45
Rep Power: 12
giovanni.medici is on a distinguished road
Thanks Tobi for the fast and comprehensive answer. Will definitely try with hexa mesh.


Sent from my iPhone using CFD Online Forum mobile app
giovanni.medici is offline   Reply With Quote

Reply

Tags
dynamicrefinefvmesh, refine mesh, tetra

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Some problem about stressedFOAM with tetra meshes weijing OpenFOAM Running, Solving & CFD 0 August 21, 2006 05:24
artifical dissipation on unstructured meshes Frederic Main CFD Forum 0 October 31, 2001 17:42
unstructured grid sreekanth Main CFD Forum 1 August 6, 2001 15:09
Finite Volume Approach For Unstructured grid APURVA SHUKLA Main CFD Forum 2 March 15, 2001 00:14
Higher Order FV Schemes for unstructured meshes Apurva Shukla Main CFD Forum 4 December 15, 2000 09:17


All times are GMT -4. The time now is 19:35.