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

PLIC and 2-1 constraint

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 18, 2023, 10:44
Question PLIC and 2-1 constraint
  #1
Member
 
Wowbagger's Avatar
 
Michael S.
Join Date: May 2020
Location: Hamburg, Germany
Posts: 51
Rep Power: 6
Wowbagger is on a distinguished road
Send a message via Skype™ to Wowbagger
Hi Foamers,

I am working on a openfoam (Foundation, openfoam 10) case with multiphase water and air.
I am now at a point where I got first results and now I want to improve especially the surface of the interface.
The resulution of the surface is very bad especially next to some walls, the refinement and especially at an NCC rotating mesh which leads to an 45 degree angle between mesh & interface flow at some time steps.

I read that the PLIC/MPLIC is a big improvement related to such refinement patterns.
Therefore I tried to use it in my case but without success. In my last few tries I always get this error message:

log.interfoam, Celllevel does not satisfy 2:1 constraint:
Code:

Create mesh for time = 0

patchToPatch: Calculating couplings between 12409 source faces and 12409 target faces
    Source min/average/max coverage = 1/1/1
    Target min/average/max coverage = 1/1/1
    Source average openness/error/depth/angle = 9.16580354401e-17/6.69305003365e-15/3.40900945691e-15/3.08058343284e-07
    Source max openness/error/depth/angle = 5.87708315685e-16/9.49461671876e-14/5.62411549512e-14/1.7075472925e-06
    26336 couplings calculated in 1.217147s
fvMeshStitcher: Connecting
    Cell min/avg/max openness = 0/5.81416459277e-17/3.44665579523e-16
Selecting fvMeshTopoChanger refiner
[0] hexRef8 : Dumping cell as obj to "/home/benutzer/OpenFOAM/benutzer-10/run/HM150/HM15019/HM15019_Pelton_laminar_fine_test/processor0/cell_2133.obj"
[0] hexRef8 : Dumping cell as obj to "/home/benutzer/OpenFOAM/benutzer-10/run/HM150/HM15019/HM15019_Pelton_laminar_fine_test/processor0/cell_2141.obj"
[1] hexRef8 : Dumping cell as obj to "/home/benutzer/OpenFOAM/benutzer-10/run/HM150/HM15019/HM15019_Pelton_laminar_fine_test/processor1/cell_55.obj"
[1] hexRef8 : Dumping cell as obj to "/home/benutzer/OpenFOAM/benutzer-10/run/HM150/HM15019/HM15019_Pelton_laminar_fine_test/processor1/cell_80.obj"
[2] hexRef8 : Dumping cell as obj to "/home/benutzer/OpenFOAM/benutzer-10/run/HM150/HM15019/HM15019_Pelton_laminar_fine_test/processor2/cell_318.obj"
[2] hexRef8 : Dumping cell as obj to "/home/benutzer/OpenFOAM/benutzer-10/run/HM150/HM15019/HM15019_Pelton_laminar_fine_test/processor2/cell_406.obj"
[0] 
[0] 
[0] --> FOAM FATAL ERROR: 
[0] Celllevel does not satisfy 2:1 constraint.
On face 6792 owner cell 2133 has refinement 2 neighbour cell 2141 has refinement 0
[0] 
[0]     From function void Foam::hexRef8::checkRefinementLevels(Foam::label, const labelList&) const
[0]     in file polyTopoChange/polyTopoChange/hexRef8/hexRef8.C at line 4799.
[0] 
FOAM parallel run aborting
Related to this error I was trying to find what could cause this - but without success.
I asume it is related to the snappy meshing or the refinement process.

Below is what I think is related to my problem.
Feel free to ask for other files in the case you think it is related to somewhere else.
I will sent them in a short time.


The case I build up is oriented on the tutorial case of the "propeller".
My Allrun script looks like this:

./Allrun:
Code:
runApplication blockMesh
runApplication surfaceFeatures

...
...some surFaceFeatureConvert...
...

runApplication decomposePar -noFields

runParallel snappyHexMesh -overwrite

# ---------------------------------------------------------------------

# SLIDING PATCH
runParallel createBaffles -overwrite
runParallel splitBaffles -overwrite
# ---------------------------------------------------------------------

# RENUMBER
runParallel renumberMesh -noFields -overwrite
# ---------------------------------------------------------------------

# CREATE NON-CONFORMAL COUPLES
runParallel createNonConformalCouples -overwrite nonCouple1 nonCouple2
runParallel checkMesh -allTopology -allGeometry -writeSets vtk
# ---------------------------------------------------------------------

# Copy the fields into the processor directories
runApplication -a decomposePar -fields -copyZero

# Run
runParallel $(getApplication)
dynamicMeshDict:
Code:
topoChanger
{
    type            refiner;

    libs            ("libfvMeshTopoChangers.so");

    mover           none;

    // How often to refine
    refineInterval  1;

    // Field to be refinement on
    field           alpha.water;

    // Refine field in between lower..upper
    lowerRefineLevel 0.001;
    upperRefineLevel 0.999;

    // Have slower than 2:1 refinement
    nBufferLayers   1;

    // Refine cells only up to maxRefinement levels
    maxRefinement   1;

    // Stop refinement if maxCells reached
    maxCells        200000;

    // Flux field and corresponding velocity field. Fluxes on changed
    // faces get recalculated by interpolating the velocity. Use 'none'
    // on surfaceScalarFields that do not need to be reinterpolated.
    correctFluxes
    (
        (phi none)
        (nHatf none)
        (rhoPhi none)
        (alphaPhi.water none)
        (ghf none)
    );

    // Write the refinement level as a volScalarField
    dumpLevel       true;
 }
What I have now / what I checked so far:
- surface of the stl file with surfaceCheck is ok.
- controlDict:
Code:
maxCo 0.5;
maxAlphaCo 0.5;
- snappyHexMeshDict:
Code:
nCellsBetweenLevels 3;
- fvSchemes:
Code:
div(phi,alpha)    Gauss PLIC interfaceCompression vanLeer 1;
checkMesh gives me the three warnings below which I assume are not critical in my case. However I do not really have the experience and of course it is not related to an 2:1 refinement.
The case is running well with the simple interface compression without PLIC.

checkMesh:
Code:
 ***Max skewness = 5.80272181423, 2 highly skew faces detected which may impair the quality of the results
 ***Cells with small determinant (< 0.001) found, number of cells: 16
 ***Concave cells (using face planes) found, number of cells: 23048
I would be happy if somebody can give me a hint...
Best regards
Michael
Wowbagger is offline   Reply With Quote

Old   August 21, 2023, 03:31
Default
  #2
Senior Member
 
JNSN's Avatar
 
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 137
Rep Power: 19
JNSN is on a distinguished road
Hi Michael,


PLIC/MPLIC is not compatible with NCC, see https://bugs.openfoam.org/view.php?id=3999


Best regards,
Jan
JNSN is offline   Reply With Quote

Old   August 21, 2023, 06:28
Default
  #3
Member
 
Wowbagger's Avatar
 
Michael S.
Join Date: May 2020
Location: Hamburg, Germany
Posts: 51
Rep Power: 6
Wowbagger is on a distinguished road
Send a message via Skype™ to Wowbagger
Hi Jan,

I suspected such a thing. Thanks for your reply.
Seems like I have to look for some other solution.

Best regards
Michael
Wowbagger is offline   Reply With Quote

Reply

Tags
ncc, plic, refinement level

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
Where PLIC stores the area of Interface in openfoam? saicharan662000@gmail.com OpenFOAM 1 January 6, 2022 23:00
PLIC in InterFOAM??? lakshay26 OpenFOAM Programming & Development 18 June 5, 2018 06:27
implementation of PLIC algorithm in ansys Fluent Andrea1984 FLUENT 2 April 24, 2012 05:11
I Need Source Code of PLIC method of Youngs Kai Yan Main CFD Forum 6 July 7, 2008 04:41
3-D PLIC (Piecewise-Linear Interface Construction) Chih-Wei Chiu Main CFD Forum 0 May 19, 2002 20:41


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