MODULE Generic_FluxF ! Given the values of the conserved variables (ux) ! this returns the flux vector (fx) F for the 3D euler eqns INTERFACE GetFluxF MODULE PROCEDURE FluxF_point MODULE PROCEDURE FluxF_line MODULE PROCEDURE FluxF_area MODULE PROCEDURE FluxF_volume END INTERFACE CONTAINS SUBROUTINE FluxF_point(ux,vx,fx) ! ---- Shared Variables USE mesh USE array_bounds USE method_parms ! ---- Shared Procedures IMPLICIT NONE DOUBLE PRECISION, INTENT(OUT) :: fx(nvars) DOUBLE PRECISION, INTENT(IN) :: ux(ncomps) DOUBLE PRECISION, INTENT(IN) :: vx(nvars) ! ---- fx_1 = rho U fx(1) = ux(2) ! ---- fx_2 = rho U**2 + P fx(2) = ux(2)*vx(2) + vx(5) ! ---- fx_3 = rho U V fx(3) = ux(2)*vx(3) ! ---- fx_4 = rho U W fx(4) = ux(2)*vx(4) ! ---- fx_4 = (E + P) U fx(5) = ( ux(5) + vx(5) ) * vx(2) ! ---- fx_(6:nvars) = rho U Scalar_s fx(6:nvars)=ux(2)*vx(6:nvars) END SUBROUTINE FluxF_point SUBROUTINE FluxF_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 U fx(1,:) = ux(2,:) ! ---- fx_2 = rho U**2 + P fx(2,:) = ux(2,:)*vx(2,:) + vx(5,:) ! ---- fx_3 = rho U V fx(3,:) = ux(2,:)*vx(3,:) ! ---- fx_4 = rho U W fx(4,:) = ux(2,:)*vx(4,:) ! ---- fx_4 = (E + P) U fx(5,:) = ( ux(5,:) + vx(5,:) ) * vx(2,:) ! ---- fx_(6:nvars) = rho U Scalar_s DO i=6,nvars fx(i,:)=ux(2,:)*vx(i,:) END DO END SUBROUTINE FluxF_line SUBROUTINE FluxF_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 U fx(1,:,:) = ux(2,:,:) ! ---- fx_2 = rho U**2 + P fx(2,:,:) = ux(2,:,:)*vx(2,:,:) + vx(5,:,:) ! ---- fx_3 = rho U V fx(3,:,:) = ux(2,:,:)*vx(3,:,:) ! ---- fx_4 = rho U W fx(4,:,:) = ux(2,:,:)*vx(4,:,:) ! ---- fx_4 = (E + P) U fx(5,:,:) = ( ux(5,:,:) + vx(5,:,:) ) * vx(2,:,:) ! ---- fx_(6:nvars) = rho U Scalar_s DO i=6,nvars fx(i,:,:)=ux(2,:,:)*vx(i,:,:) END DO END SUBROUTINE FluxF_area SUBROUTINE FluxF_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('FluxF_volume') ! ---- fx_1 = rho U fx(1,:,:,:) = ux(2,:,:,:) ! ---- fx_2 = rho U**2 + P fx(2,:,:,:) = ux(2,:,:,:)*vx(2,:,:,:) + vx(5,:,:,:) ! ---- fx_3 = rho U V fx(3,:,:,:) = ux(2,:,:,:)*vx(3,:,:,:) ! ---- fx_4 = rho U W fx(4,:,:,:) = ux(2,:,:,:)*vx(4,:,:,:) ! ---- fx_4 = (E + P) U fx(5,:,:,:) = ( ux(5,:,:,:) + vx(5,:,:,:) ) * vx(2,:,:,:) ! ---- fx_(6:nvars) = rho U Scalar_s DO i=6,nvars fx(i,:,:,:) = ux(2,:,:,:)*vx(i,:,:,:) END DO call cleslog_log_exit('FluxF_volume') END SUBROUTINE FluxF_volume END MODULE Generic_FluxF