Setup scale required for relative and absolute residual for writing in the file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(schemetype), | intent(in) | :: | scheme | finite-volume Schemes |
||
type(flowtype), | intent(in) | :: | flow | Information about fluid flow: freestream-speed, ref-viscosity,etc. |
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