Hi Dmitry,

For the box method the dofs are at the vertices. The control volume for the 
vertex-centered FV method is defined on a dual grid.
These vertex control volumes are split into subcontrolvolume where each 
subcontrolvolume is the intersection of the vertex control volume and an 
adjacent primary grid element (element in Dumux).
We do element-wise assembly so the element residual only assembles the part of 
the vertex residual belonging to its subcontrolvolume. You have to add up the 
contributions to arrive at the full residual for each control volume (vertex 
dof).

dofIndex is the index of the control volume (equal to the vertex index) the 
subcontrolvolume is part of.

Maybe the Dumux paper helps to clear that up: 
https://doi.org/10.1016/j.camwa.2020.02.012 
<https://doi.org/10.1016/j.camwa.2020.02.012>

Best wishes
Timo
-- 
_________________________________________________

Timo Koch                                      phone: +49 711 685 64676
IWS, Universität Stuttgart                  fax:   +49 711 685 60430
Pfaffenwaldring 61         email: timo.k...@iws.uni-stuttgart.de
D-70569 Stuttgart             url: www.iws.uni-stuttgart.de/en/lh2/
_________________________________________________

> On 25. May 2020, at 17:15, Dmitry Pavlov <dmitry.pav...@outlook.com> wrote:
> 
> Hello,
> 
> I am writing my own local residual for porous medium flow with the Box method 
> with my own addFluxDerivatives and all. I have a quick question.
> 
> When iterating over sub-control volumes (scvs), I supposed that they are 
> indexed in the Jacobian by their dofIndex(). I see that there are as many 
> different dofIndex-es as there are scvs in the grid.
> 
> I supposed that scv.dofIndex() has one-to-one mapping to scv.center(), in one 
> assembly, anyway. But I did some debug printing and I see that I was wrong. 
> In different addFluxDerivatives() calls, during one assembly, the same 
> dofIndex is assigned to different scvs.
> 
> The grid, if it matters, is 2D (actually 1D) 4x1, dimensions 150x800.
> Assemble: r(x^k) = dS/dt + div F - q;   M = grad r
> addFluxDerivatives called for face at [9.375 400]
>   scv at [9.375 200] has dofIndex = 0
>   scv at [28.125 200] has dofIndex = 1
>   scv at [9.375 600] has dofIndex = 5
>   scv at [28.125 600] has dofIndex = 6
> 
> addFluxDerivatives called for face at [28.125 400]
>   scv at [9.375 200] has dofIndex = 0
>   scv at [28.125 200] has dofIndex = 1
>   scv at [9.375 600] has dofIndex = 5
>   scv at [28.125 600] has dofIndex = 6
> 
> addFluxDerivatives called for face at [18.75 200]
>   scv at [9.375 200] has dofIndex = 0
>   scv at [28.125 200] has dofIndex = 1
>   scv at [9.375 600] has dofIndex = 5
>   scv at [28.125 600] has dofIndex = 6
> 
> addFluxDerivatives called for face at [18.75 600]
>   scv at [9.375 200] has dofIndex = 0
>   scv at [28.125 200] has dofIndex = 1
>   scv at [9.375 600] has dofIndex = 5
>   scv at [28.125 600] has dofIndex = 6
> 
> addFluxDerivatives called for face at [46.875 400]
>   scv at [46.875 200] has dofIndex = 1
>   scv at [65.625 200] has dofIndex = 2
>   scv at [46.875 600] has dofIndex = 6
>   scv at [65.625 600] has dofIndex = 7
> You see that as soon as we got to the faces in the second grid cell, the 
> dofIndex-es 1 and 6 are assigned to different scvs than they were in the 
> first grid cell. Only four dofIndex-es, out of ten, always map to the same 
> scvs: 0, 4, 5, 9.
> 
> At this point I am wondering whether I misunderstand something about how the 
> Jacobian should be built and maybe the trouble that I am having with the 
> convergence may come from it.
> 
> Best regards,
> 
> Dmitry
> 
> 
> 
> _______________________________________________
> Dumux mailing list
> Dumux@listserv.uni-stuttgart.de
> https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

_______________________________________________
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

Reply via email to