[FLASH-BUGS] reflecting BC for MHD
Timur Linde
t-linde at uchicago.edu
Fri Mar 7 14:17:38 CST 2003
Dear Sean,
You are correct. The reflecting boundary condition case is not
implemented in the main source tree, although it is trivial
to do so. However, reflecting the flow in the MHD case is not
as trivial as it is in the hydro case. Specifically, you need
to account for conducting properties of the boundary itself.
Simple reflection of the field is valid only for perfectly
conducting boundaries, but this is not the only case one can
consider. We do, probably, need to implement some default case.
Timur
On Fri, 7 Mar 2003, Sean Matt wrote:
> Hello,
>
> We have been running a new 3D MHD test case in FLASH (spin down of
> a magnetic rotator), and upon getting an incorrect result, we have
> realized that the standard "reflecting" boundary condition is not properly
> set for the magnetic field parameters. The fix should be trivial, but
> since we believe this is incorrect for any general MHD problem in any
> number of dimensions, it should probably be fixed in the main source tree.
> The reflecting boundary condition (and others) is set in the
> paramesh routine source/mesh/amr/paramesh2.0/tot_bnd.F90. It is
> correctly set for hydrodynamics. That is, all quantities are constant,
> except that the component of velocity that is normal to the boundary
> (e.g., velx for an x boundary) should reverse sign across the boundary.
> For MHD, in addition to the normal hydro conditions, the component
> of the magnetic field that is parallel to the boundary (e.g., both magy
> and magz for an x boundary) should reverse sign.
> The fix may look something like the following:
>
>
> If the original BC looks like this:
>
> ...
> ivelx = dBaseKeyNumber("velx")
> ...
> ! -X reflecting boundary
> ...
> do i = 1, nguard
>
> solnData(:,i,j,k) = solnData(:,ic,j,k)
> if (ivelx .gt. 0) then
> solnData(ivelx,i,j,k) = -solnData(ivelx,ic,j,k)
> endif
> ic = ic - 1
>
> end do
> ...
>
>
> The new BC should look something like this:
>
> ...
> ivelx = dBaseKeyNumber("velx")
> imagy = dBaseKeyNumber("magy")
> imagz = dBaseKeyNumber("magz")
> ...
> ! -X reflecting boundary
> ...
> do i = 1, nguard
>
> solnData(:,i,j,k) = solnData(:,ic,j,k)
> if (ivelx .gt. 0) then
> solnData(ivelx,i,j,k) = -solnData(ivelx,ic,j,k)
> endif
> if (imagy .gt. 0) then
> solnData(imagy,i,j,k) = -solnData(imagy,ic,j,k)
> endif
> if (imagz .gt. 0) then
> solnData(imagz,i,j,k) = -solnData(imagz,ic,j,k)
> endif
> ic = ic - 1
>
> end do
> ...
>
>
>
More information about the flash-bugs
mailing list