Raising this as a question rather than a confirmed bug — the viscous cylindrical assembly is more involved than the scalar case I was working on, and I have not verified it numerically.
Context. In MFC's 3D cylindrical mode (grid_geometry == 3) the third coordinate is θ and dz is in radians, so a physical azimuthal derivative needs a 1/r: once for the gradient, once for the divergence.
While adding Fourier heat conduction (#1906) the θ-direction flux was initially wrong by exactly r² for this reason. The fix folds both metric factors into the face spacing, and a ring-by-ring convergence study confirmed it (the recovered θ contribution goes from scaling as r² to being flat in r).
The question. m_viscous.fpp divides grad_z by y_cc(k) in several places, which supplies the gradient-side 1/r. But the divergence side in m_rhs.fpp applies 1._wp/dz(l) with no y_cc factor on this path — whereas the advection path for the same direction uses inv_ds = 1._wp/(dz(k)*y_cc(q)).
If that reading is right, the viscous azimuthal terms carry one 1/r where they need two, and would be off by a factor of r in 3D cylindrical. If instead the second factor is folded in somewhere I did not find, this is a non-issue and worth a comment saying where.
A θ-direction convergence check on a 3D cylindrical viscous case against a known solution would settle it. The setup added in #1906 (examples/3D_cyl_azimuthal_conduction_convergence) is a template: uniform pressure, zero velocity, a profile varying in θ whose exact answer is known, measured in a single time step so nothing else contributes.
Not touched in #1906, which restricts itself to the conduction term.
Raising this as a question rather than a confirmed bug — the viscous cylindrical assembly is more involved than the scalar case I was working on, and I have not verified it numerically.
Context. In MFC's 3D cylindrical mode (
grid_geometry == 3) the third coordinate is θ anddzis in radians, so a physical azimuthal derivative needs a1/r: once for the gradient, once for the divergence.While adding Fourier heat conduction (#1906) the θ-direction flux was initially wrong by exactly
r²for this reason. The fix folds both metric factors into the face spacing, and a ring-by-ring convergence study confirmed it (the recovered θ contribution goes from scaling asr²to being flat inr).The question.
m_viscous.fppdividesgrad_zbyy_cc(k)in several places, which supplies the gradient-side1/r. But the divergence side inm_rhs.fppapplies1._wp/dz(l)with noy_ccfactor on this path — whereas the advection path for the same direction usesinv_ds = 1._wp/(dz(k)*y_cc(q)).If that reading is right, the viscous azimuthal terms carry one
1/rwhere they need two, and would be off by a factor ofrin 3D cylindrical. If instead the second factor is folded in somewhere I did not find, this is a non-issue and worth a comment saying where.A θ-direction convergence check on a 3D cylindrical viscous case against a known solution would settle it. The setup added in #1906 (
examples/3D_cyl_azimuthal_conduction_convergence) is a template: uniform pressure, zero velocity, a profile varying in θ whose exact answer is known, measured in a single time step so nothing else contributes.Not touched in #1906, which restricts itself to the conduction term.