fix Subroutine

private subroutine fix(var, fix_val, face)

Generalized subroutine to fix particular value at particular face

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(out), dimension(-2:imx+2, -2:jmx+2, -2:kmx+2):: var

Variable of which values are being fixed in the ghost cell

real(kind=wp), intent(in), dimension(1:6):: fix_val

Amount of value that need to be fixed.

character(len=*), intent(in) :: face

Name of the face at which boundary condition is called


Called by

proc~~fix~~CalledByGraph proc~fix fix proc~subsonic_outlet subsonic_outlet proc~subsonic_outlet->proc~fix proc~supersonic_inlet supersonic_inlet proc~supersonic_inlet->proc~fix proc~subsonic_inlet subsonic_inlet proc~subsonic_inlet->proc~fix proc~far_field far_field proc~far_field->proc~fix proc~total_pressure total_pressure proc~total_pressure->proc~fix proc~populate_ghost_primitive populate_ghost_primitive proc~populate_ghost_primitive->proc~subsonic_outlet proc~populate_ghost_primitive->proc~supersonic_inlet proc~populate_ghost_primitive->proc~subsonic_inlet proc~populate_ghost_primitive->proc~far_field proc~populate_ghost_primitive->proc~total_pressure proc~get_total_conservative_residue get_total_conservative_Residue proc~get_total_conservative_residue->proc~populate_ghost_primitive proc~get_next_solution get_next_solution proc~get_next_solution->proc~get_total_conservative_residue proc~iterate_one_more_time_step iterate_one_more_time_step proc~iterate_one_more_time_step->proc~get_next_solution program~main main program~main->proc~iterate_one_more_time_step

Contents

Source Code

fix

Source Code

      subroutine fix(var, fix_val, face)
        !< Generalized subroutine to fix particular value
        !< at particular face
        implicit none
        real(wp), dimension(-2:imx+2, -2:jmx+2, -2:kmx+2) , intent(out) :: var
        !< Variable of which values are being fixed in the ghost cell
        real(wp), dimension(1:6)       , intent(in)  :: fix_val
        !< Amount of value that need to be fixed.
        character(len=*)         , intent(in)  :: face
        !< Name of the face at which boundary condition is called

        select case(face)
          case("imin")
              var(      0, 1:jmx-1, 1:kmx-1) = fix_val(1)
              var(     -1, 1:jmx-1, 1:kmx-1) = fix_val(1)
              var(     -2, 1:jmx-1, 1:kmx-1) = fix_val(1)
           case("imax")
              var(  imx  , 1:jmx-1, 1:kmx-1) = fix_val(2)
              var(  imx+1, 1:jmx-1, 1:kmx-1) = fix_val(2)
              var(  imx+2, 1:jmx-1, 1:kmx-1) = fix_val(2)
          case("jmin")
              var(1:imx-1,       0, 1:kmx-1) = fix_val(3)
              var(1:imx-1,      -1, 1:kmx-1) = fix_val(3)
              var(1:imx-1,      -2, 1:kmx-1) = fix_val(3)
          case("jmax")
              var(1:imx-1,   jmx  , 1:kmx-1) = fix_val(4)
              var(1:imx-1,   jmx+1, 1:kmx-1) = fix_val(4)
              var(1:imx-1,   jmx+2, 1:kmx-1) = fix_val(4)
          case("kmin")
              var(1:imx-1, 1:jmx-1,       0) = fix_val(5)
              var(1:imx-1, 1:jmx-1,      -1) = fix_val(5)
              var(1:imx-1, 1:jmx-1,      -2) = fix_val(5)
          case("kmax")
              var(1:imx-1, 1:jmx-1,   kmx  ) = fix_val(6)
              var(1:imx-1, 1:jmx-1,   kmx+1) = fix_val(6)
              var(1:imx-1, 1:jmx-1,   kmx+2) = fix_val(6)
          case DEFAULT
            !print*, "ERROR: wrong face for boundary condition"
            Fatal_error
        end select
            
      end subroutine fix