aboutsummaryrefslogtreecommitdiff
path: root/src/GRHydro_CalcUpdate.F90
diff options
context:
space:
mode:
authorbmundim <bmundim@c83d129a-5a75-4d5a-9c4d-ed3a5855bf45>2011-04-13 03:29:13 +0000
committerbmundim <bmundim@c83d129a-5a75-4d5a-9c4d-ed3a5855bf45>2011-04-13 03:29:13 +0000
commit4adfcb611a12689096a604e2a510b7ff12c145f1 (patch)
tree37b8c6c6627e625b3fe7d7194518e983350884d1 /src/GRHydro_CalcUpdate.F90
parent7e9323a4e1f5ccedc9d11f4a425b9b03d2325ed7 (diff)
RIT MHD development:
1) Fix a bug in the divergence cleaning implementation: a psidc term in the induction equation was implemented as a source term where it was supposed to be coded as part of the flux calculation. 2) Introduce divB as a diagnostic grid function. 3) Remove an old file: GRHydro_CalcUpdateM.F90 git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinEvolve/GRHydro/trunk@228 c83d129a-5a75-4d5a-9c4d-ed3a5855bf45
Diffstat (limited to 'src/GRHydro_CalcUpdate.F90')
-rw-r--r--src/GRHydro_CalcUpdate.F9018
1 files changed, 16 insertions, 2 deletions
diff --git a/src/GRHydro_CalcUpdate.F90 b/src/GRHydro_CalcUpdate.F90
index 81de7db..452b070 100644
--- a/src/GRHydro_CalcUpdate.F90
+++ b/src/GRHydro_CalcUpdate.F90
@@ -39,7 +39,7 @@ subroutine UpdateCalculation(CCTK_ARGUMENTS)
DECLARE_CCTK_FUNCTIONS
CCTK_INT :: i,j,k,itracer
- CCTK_REAL :: idx, alp_l, alp_r
+ CCTK_REAL :: idx, alp_l, alp_r, Bvec_l, Bvec_r
CCTK_INT :: type_bits, atmosphere, not_atmosphere
@@ -55,7 +55,7 @@ subroutine UpdateCalculation(CCTK_ARGUMENTS)
if (use_weighted_fluxes == 0) then
- !$OMP PARALLEL DO PRIVATE(i,j,itracer,alp_l, alp_r)
+ !$OMP PARALLEL DO PRIVATE(i,j,itracer,alp_l,alp_r,Bvec_l,Bvec_r)
do k = GRHydro_stencil + 1, cctk_lsh(3) - GRHydro_stencil
do j = GRHydro_stencil + 1, cctk_lsh(2) - GRHydro_stencil
do i = GRHydro_stencil + 1, cctk_lsh(1) - GRHydro_stencil
@@ -95,6 +95,13 @@ subroutine UpdateCalculation(CCTK_ARGUMENTS)
(alp_l * psidcflux(i-xoffset,j-yoffset,k-zoffset) - &
alp_r * psidcflux(i,j,k)) * idx
endif
+ if(track_divB.ne.0) then
+ Bvec_l = 0.5d0 * (Bvec(i,j,k,flux_direction) + &
+ Bvec(i-xoffset,j-yoffset,k-zoffset,flux_direction))
+ Bvec_r = 0.5d0 * (Bvec(i,j,k,flux_direction) + &
+ Bvec(i+xoffset,j+yoffset,k+zoffset,flux_direction))
+ divB(i,j,k) = divB(i,j,k) + ( alp_l * Bvec_l - alp_r * Bvec_r ) * idx
+ endif
endif
if (evolve_tracer .ne. 0) then
@@ -248,6 +255,13 @@ subroutine UpdateCalculation(CCTK_ARGUMENTS)
(psidcflux(i-xoffset,j-yoffset,k-zoffset) - &
psidcflux(i,j,k)) * idx
endif
+ if(track_divB.ne.0) then
+ Bvec_l = 0.5d0 * (Bvec(i,j,k,flux_direction) + &
+ Bvec(i-xoffset,j-yoffset,k-zoffset,flux_direction))
+ Bvec_r = 0.5d0 * (Bvec(i,j,k,flux_direction) + &
+ Bvec(i+xoffset,j+yoffset,k+zoffset,flux_direction))
+ divB(i,j,k) = divB(i,j,k) + ( Bvec_l - Bvec_r ) * idx
+ endif
endif
enddo