setup_scale Subroutine

private subroutine setup_scale(scheme, flow)

Setup scale required for relative and absolute residual for writing in the file.

Arguments

Type IntentOptional AttributesName
type(schemetype), intent(in) :: scheme

finite-volume Schemes

type(flowtype), intent(in) :: flow

Information about fluid flow: freestream-speed, ref-viscosity,etc.


Called by

proc~~setup_scale~~CalledByGraph proc~setup_scale setup_scale proc~setup_resnorm setup_resnorm proc~setup_resnorm->proc~setup_scale proc~setup_solver setup_solver proc~setup_solver->proc~setup_resnorm proc~start_run start_run proc~start_run->proc~setup_solver program~main main program~main->proc~start_run

Contents

Source Code


Source Code

    subroutine setup_scale(scheme, flow)
      !< Setup scale required for relative and absolute
      !< residual for writing in the file.
      implicit none
      type(schemetype), intent(in) :: scheme
      !< finite-volume Schemes
      type(flowtype), intent(in) :: flow
      !< Information about fluid flow: freestream-speed, ref-viscosity,etc.
      Res_scale(0) = 1.
      Res_scale(1) = flow%density_inf*flow%vel_mag
      Res_scale(2) = flow%density_inf*flow%vel_mag*flow%vel_mag
      Res_scale(3) = flow%density_inf*flow%vel_mag*flow%vel_mag
      Res_scale(4) = flow%density_inf*flow%vel_mag*flow%vel_mag
      Res_scale(5) = (0.5*flow%density_inf*flow%vel_mag**3 + &
                     ((flow%gm/(flow%gm-1.))*flow%pressure_inf))

      select case(trim(scheme%turbulence))
        case('none')
          !do nothing
          continue
        case('sst', 'sst2003')
          Res_scale(6) = flow%density_inf*flow%vel_mag*flow%tk_inf
          Res_scale(7) = flow%density_inf*flow%vel_mag*flow%tw_inf
        case('kkl')
          Res_scale(6) = flow%density_inf*flow%vel_mag*flow%tk_inf
          Res_scale(7) = flow%density_inf*flow%vel_mag*flow%tkl_inf
        case('des')
          Res_scale(6) = flow%density_inf*flow%vel_mag*flow%tk_inf
          Res_scale(7) = flow%density_inf*flow%vel_mag*flow%tw_inf
        case('sa', 'saBC')
          Res_scale(6) = flow%density_inf*flow%vel_mag*flow%tv_inf
        case('kw')
          Res_scale(6) = flow%density_inf*flow%vel_mag*flow%tk_inf
          Res_scale(7) = flow%density_inf*flow%vel_mag*flow%tw_inf
        case('ke')
          Res_scale(6) = flow%density_inf*flow%vel_mag*flow%tk_inf
          Res_scale(7) = flow%density_inf*flow%vel_mag*flow%te_inf
        case DEFAULT
          Fatal_error
      end select

    end subroutine setup_scale