Closed conradtchan closed 1 month ago
I just did the Laplacian calculation again and I think that is a typo...
It's supposed to be
+ ( idx3(k)+idx3(k+1) )*dxi1(i)*dxi2(j) )
The reason why the dx3
values are not really defined for the ks-2
indices is because it's sort of undefinable. The dxi3(k)
values are the distances from interface to interface of the k
th cell so that is defined by default. The dx3(k)
values are the distances from cell centre to cell centre (cell k-1
to k
) so unless the ks-3
'th cell is defined, there is no way to calculate the distance for dx3(ks-2)
in general.
There should be nowhere in the code where this value is used, so this is simply a typo. Thanks for catching this!
On line 376 of
gravity_hyperbolic.f90
:where
k=gks-1,gke
.However,
idx3
is only initialised fromks_global-1
(same asgks-1
) in gridset.f90. Soidx3(k-1)
is a potentially uninitialised variable.@ryosuke-hirai could you please help me understand what physical length
dx3
and it's inverseidx3
describes? Naively, I would think that thek-1
value should be initialised because the grid is periodic in the phi direction. Or is there a mistake in the calculation oflap_coeff(0,i,j,k)
?