MODULE Generic_FluxH ! Given the values of the conserved variables (ux) ! this returns the flux vector (fx) H for the 3D euler eqns INTERFACE GetFluxH MODULE PROCEDURE FluxH_point MODULE PROCEDURE FluxH_line MODULE PROCEDURE FluxH_area MODULE PROCEDURE FluxH_volume END INTERFACE CONTAINS SUBROUTINE FluxH_point(ux,vx,fx) ! ---- Shared Variables USE mesh USE array_bounds USE method_parms ! ---- Shared Procedures IMPLICIT NONE DOUBLE PRECISION, INTENT(IN) :: ux(ncomps) DOUBLE PRECISION, INTENT(IN) :: vx(nvars) DOUBLE PRECISION, INTENT(OUT) :: fx(nvars) INTEGER :: i ! ---- fx_1 = rho W fx(1) = ux(4) ! ---- fx_2 = rho U W fx(2) = ux(2) * vx(4) ! ---- fx_3 = rho V W fx(3) = ux(3) * vx(4) ! ---- fx_4 = rho W**2 + P fx(4) = ux(4) * vx(4) + vx(5) ! ---- fx_5 = (E + P) W fx(5) = ( ux(5) + vx(5) ) * vx(4) ! ---- fx_(6:nvars) = rho W Scalar_s DO i=6,nvars fx(i)=ux(4)*vx(i) END do END SUBROUTINE FluxH_point SUBROUTINE FluxH_line(ux,vx,fx) ! ---- Shared Variables USE mesh USE array_bounds USE method_parms ! ---- Shared Procedures IMPLICIT NONE DOUBLE PRECISION, INTENT(IN) :: ux(ncomps,ixlo:ixhi) DOUBLE PRECISION, INTENT(IN) :: vx(nvars,ixlo:ixhi) DOUBLE PRECISION, INTENT(OUT) :: fx(nvars,ixlo:ixhi) INTEGER :: i ! ---- fx_1 = rho W fx(1,:) = ux(4,:) ! ---- fx_2 = rho U W fx(2,:) = ux(2,:) * vx(4,:) ! ---- fx_3 = rho V W fx(3,:) = ux(3,:) * vx(4,:) ! ---- fx_4 = rho W**2 + P fx(4,:) = ux(4,:) * vx(4,:) + vx(5,:) ! ---- fx_5 = (E + P,:) W fx(5,:) = ( ux(5,:) + vx(5,:) ) * vx(4,:) ! ---- fx_(6:nvars) = rho W Scalar_s DO i=6,nvars fx(i,:)=ux(4,:)*vx(i,:) END DO END SUBROUTINE FluxH_line SUBROUTINE FluxH_area(ux,vx,fx) ! ---- Shared Variables USE mesh USE array_bounds USE method_parms ! ---- Shared Procedures IMPLICIT NONE DOUBLE PRECISION, INTENT(IN) :: ux(ncomps,ixlo:ixhi,iylo:iyhi) DOUBLE PRECISION, INTENT(IN) :: vx(nvars,ixlo:ixhi,iylo:iyhi) DOUBLE PRECISION, INTENT(OUT) :: fx(nvars,ixlo:ixhi,iylo:iyhi) INTEGER :: i ! ---- fx_1 = rho W fx(1,:,:) = ux(4,:,:) ! ---- fx_2 = rho U W fx(2,:,:) = ux(2,:,:) * vx(4,:,:) ! ---- fx_3 = rho V W fx(3,:,:) = ux(3,:,:) * vx(4,:,:) ! ---- fx_4 = rho W**2 + P fx(4,:,:) = ux(4,:,:) * vx(4,:,:) + vx(5,:,:) ! ---- fx_5 = (E + P) W fx(5,:,:) = ( ux(5,:,:) + vx(5,:,:) ) * vx(4,:,:) ! ---- fx_(6:nvars) = rho W Scalar_s DO i=6,nvars fx(i,:,:)=ux(4,:,:)*vx(i,:,:) END DO END SUBROUTINE FluxH_area SUBROUTINE FluxH_volume(ux,vx,fx) ! ---- Shared Variables USE mesh USE array_bounds USE method_parms ! ---- Shared Procedures IMPLICIT NONE DOUBLE PRECISION, INTENT(IN) :: ux(ncomps,ixlo:ixhi,iylo:iyhi,izlo:izhi) DOUBLE PRECISION, INTENT(IN) :: vx(nvars,ixlo:ixhi,iylo:iyhi,izlo:izhi) DOUBLE PRECISION, INTENT(OUT) :: fx(nvars,ixlo:ixhi,iylo:iyhi,izlo:izhi) INTEGER :: i call cleslog_log_enter('FluxH_volume') ! ---- fx_1 = rho W fx(1,:, :,:) = ux(4,:, :,:) ! ---- fx_2 = rho U W fx(2,:, :,:) = ux(2,:, :,:) * vx(4,:, :,:) ! ---- fx_3 = rho V W fx(3,:, :,:) = ux(3,:, :,:) * vx(4,:, :,:) ! ---- fx_4 = rho W**2 + P fx(4,:, :,:) = ux(4,:, :,:) * vx(4,:, :,:) + vx(5,:, :,:) ! ---- fx_5 = (E + P) W fx(5,:, :,:) = ( ux(5,:, :,:) + vx(5,:, :,:) ) * vx(4,:, :,:) ! ---- fx_(6:nvars) = rho W Scalar_s DO i=6,nvars fx(i,:, :,:)=ux(4,:, :,:)*vx(i,:, :,:) END DO call cleslog_log_exit('FluxH_volume') END SUBROUTINE FluxH_volume END MODULE Generic_FluxH