Adding constant momentum source in cylindrical coordinates #432
Replies: 1 comment 2 replies
-
The code you wrote should be correct. The paper you cite (see also the equations near 2.14 of this PhD thesis, for more details) is adding a phi-momentum source term, but in a different context. The conservation laws/evolution equations have the form ∂t(conserved) + div(flux) = Sphysical(primitive). In non-Cartesian coordinates, the divergence operator has extra/modified terms, so this becomes ∂t(conserved) + ∂x1(flux1) + ∂x2(flux2) + ∂x3(flux3) = Sgeometric(primitive) + Sphysical(primitive). The problem is, if you naively integrate this equation over a single cell to turn it into a finite-volume scheme, the fluxes evaluated at cell faces won't combine with the cell-averaged geometric source term to exactly get the discrete divergence operator you want, causing things like secular errors in angular momentum. As it turns out, you can write the geometric source term in terms of face-centered fluxes (rather than cell-centered conserved or primitive variables): ∂t(conserved) + ∂x1(flux1) + ∂x2(flux2) + ∂x3(flux3) = S'geometric(fluxes) + Sphysical(primitive). Even if Sgeometric doesn't depend on position, S'geometric may well do so. However, none of this affects the physical source terms you are likely to be implementing as a user. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
I want to add a constant force/volume(force density?) source in the azimuthal direction to the cylindrical system(r, phi, z) that I am simulating. The snippet of my code that does this is shown below:
where SourceStrength is a number that is provided in the athinput file. Is this the right way to add a force/volume source in cylindrical coordinates that is independent of x1? I was looking at Skinner and Ostriker's paper (here) and I saw the source term in the momentum equation that contained factors of x1(or r).
To understand this, I looked at line 320 of /src/coordinates/cylindrical.cpp which confused me even further. Is
coord_src2_i_(i)
the same as the constant momentum density source termSourceStrength
?My ultimate objective is to add a constant force/volume source in the azimuthal(x2(or phi)) direction. Any feedback would be appreciated.
Thank you,
Rahul
Beta Was this translation helpful? Give feedback.
All reactions