Re: 2D anisotropic unstructured mesh and non-classical FV schemes

2017-10-18 Thread F Hssn
>> If you wish to use an unstructured Delaunay mesh, it has
>> to be isotropic (equilateral triangles) or near-isotropic otherwise
>> the control volume calculation will result in overlaps and the
>> conservation property will be violated (the solution would more likely
>> be incorrect).
>
> CC-FVM is a direct discretization of the divergence theorem. As such, I'm 
> pretty sure it is guaranteed to be conservative.
>
> Non-orthogonality will lead to fluxes being wrong, but they will still be 
> conservative (whatever they flux out of one cell, they > deposit in the 
> neighbor).

I guess what I said would've been clearer if I had mentioned VC-FVM at
the top (I only mentioned it close to the end of my post).

My description was purely from the VC-FVM point-of-view, hence the
'calculation of control volume' part, which is an extra step and has
many algorithmic variations of its own, e.g., median dual scheme,
containment dual scheme, etc, (whereas in CC-FVM, the triangle itself
is the control volume). Though from your description, doesn't look
like CC-FVM is without problems either ("fluxes being wrong").
___
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]


Re: 2D anisotropic unstructured mesh and non-classical FV schemes

2017-10-18 Thread Guyer, Jonathan E. Dr. (Fed)
Daniel is much better versed in the nuances of FV schemes than I am, but I did 
want to question one assertion you made: 

> On Oct 16, 2017, at 6:16 PM, F Hssn  wrote:
> 
> If you wish to use an unstructured Delaunay mesh, it has
> to be isotropic (equilateral triangles) or near-isotropic otherwise
> the control volume calculation will result in overlaps and the
> conservation property will be violated (the solution would more likely
> be incorrect).

CC-FVM is a direct discretization of the divergence theorem. As such, I'm 
pretty sure it is guaranteed to be conservative.

Non-orthogonality will lead to fluxes being wrong, but they will still be 
conservative (whatever they flux out of one cell, they deposit in the neighbor).


> On Oct 17, 2017, at 4:07 PM, F Hssn  wrote:
> 
>> What is an anisotropic mesh?
> 
> By anisotropic, I mean the mesh having low-quality triangles (skinny
> triangles, as opposed to equilateral triangles), strategically
> oriented so they reduce the number of vertices required but do not
> negatively affect the resolution of the functions or solutions
> involved (e.g., the interpolation error does not increase compared to
> an isotropic mesh where all triangles are equilateral or
> near-equilateral).
> 
> bamg is a good anisotropic mesh generator and its user manual [1]
> contains examples of anisotropic meshes (e.g., Fig 12 on page 14).
> 
> I should point out that when I say anisotropic quad-tree based
> axis-aligned mesh, I really mean quasi-ansiotropy, since an
> axis-aligned mesh can only orient skinny triangles along x or y axis.
> If your solution has an interface layer that is oriented in neither,
> e.g., if it's at a 45 degree angle, an axis-aligned mesh would not be
> able to make use of anisotropy and would end up using way more
> vertices instead (for constructing small rectangles along the layer).
> (An illustration of an axis-aligned mesh: 
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fimgur.com%2F15pyjHG=02%7C01%7Cjonathan.guyer%40nist.gov%7C0cd9082479634078c46808d5159ac7e0%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636438676887192908=SdR7MZg8rnTndTHH5p%2Fqxxni8s4KPo1KQLubiNVAMQg%3D=0)
> 
> [1] 
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ljll.math.upmc.fr%2Fhecht%2Fftp%2Fbamg%2Fbamg.pdf=02%7C01%7Cjonathan.guyer%40nist.gov%7C0cd9082479634078c46808d5159ac7e0%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C1%7C636438676887192908=ATMC%2FZGC9k5g%2FIs%2BqED%2F1sFbMIp90LK84urX3Py6RS4%3D=0
> ___
> fipy mailing list
> fipy@nist.gov
> http://www.ctcms.nist.gov/fipy
>  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]


___
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]


Re: 2D anisotropic unstructured mesh and non-classical FV schemes

2017-10-17 Thread F Hssn
> What is an anisotropic mesh?

By anisotropic, I mean the mesh having low-quality triangles (skinny
triangles, as opposed to equilateral triangles), strategically
oriented so they reduce the number of vertices required but do not
negatively affect the resolution of the functions or solutions
involved (e.g., the interpolation error does not increase compared to
an isotropic mesh where all triangles are equilateral or
near-equilateral).

bamg is a good anisotropic mesh generator and its user manual [1]
contains examples of anisotropic meshes (e.g., Fig 12 on page 14).

I should point out that when I say anisotropic quad-tree based
axis-aligned mesh, I really mean quasi-ansiotropy, since an
axis-aligned mesh can only orient skinny triangles along x or y axis.
If your solution has an interface layer that is oriented in neither,
e.g., if it's at a 45 degree angle, an axis-aligned mesh would not be
able to make use of anisotropy and would end up using way more
vertices instead (for constructing small rectangles along the layer).
(An illustration of an axis-aligned mesh: https://imgur.com/15pyjHG)

[1] https://www.ljll.math.upmc.fr/hecht/ftp/bamg/bamg.pdf
___
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]


Re: 2D anisotropic unstructured mesh and non-classical FV schemes

2017-10-17 Thread Daniel Wheeler
Thanks for your interest in FiPy

On Mon, Oct 16, 2017 at 6:16 PM, F Hssn  wrote:
>
> So my questions are:
>
> - Does fipy handle anisotropic unstructured meshes without any
> problem? (I'm specifically looking to use bamg for 2D mesh adaptation
> based on interpolation error reduction/equidistribution)

What is an anisotropic mesh?

FiPy does "handle" unstructured meshes in that the problem will solve,
however, the accuracy decreases as the non-orthogonality and
non-conjunctionality increases (as you pointed out). There has been an
attempt to implement terms to correct for the non-orthogonality, see

   
https://github.com/usnistgov/fipy/blob/develop/fipy/terms/diffusionTermCorrection.py

and

   
https://github.com/usnistgov/fipy/blob/develop/fipy/terms/diffusionTermNoCorrection.py

You might want to try playing with the corrected diffusion term to see
how well it works. I can't find any examples of its use though.

See also

 - https://www.mail-archive.com/fipy@nist.gov/msg03758.html
 - https://www.mail-archive.com/fipy@nist.gov/msg03757.html
 - https://www.mail-archive.com/fipy@nist.gov/msg03765.html

> - If not, does fipy provide (or provide a way to implement) MPFA
> (multi-point flux approximation) or some other non-classical scheme
> (like HMM) that allows anisotropic unstructured meshes (as discussed
> in the Drioniou paper [1]) ?

I don't think I can easily answer that without a great deal of work,
but I did skim over the Drioniou paper,
https://arxiv.org/pdf/1407.1567.pdf. I can't foresee all the issues
with implementing the various schemes but one that does come to mind
is having to use neighbor's neighbor values to compute fluxes, which I
think these schemes require. It would require a lot of changes to FiPy
to set that up efficiently. However, I will certainly keep this paper
on my list of items to research further. Thanks for highlighting it.

> - Or, does fipy allow any other way to make vertex-centered control
> volume calculation that can take into account anisotropy and can make
> sure there are no control volume overlaps (and as a result, the
> coefficients stay positive, and monotonicity is maintained, and none
> of the nice properties are violated) ?

No, FiPy is definitely not set up for vertex centered. The above
cell-centered approach is the way to go.

-- 
Daniel Wheeler
___
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]