Compute the current time step, by means of CFL condition.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(burgers), | intent(in) | :: | self | Burgers field. |
||
real(kind=R_P), | intent(in) | :: | CFL | Courant-Friedricks-Lewi stability coefficient. |
Current time step.
pure function compute_dt(self, CFL) result(dt)
!---------------------------------------------------------------------------------------------------------------------------------
!< Compute the current time step, by means of CFL condition.
!---------------------------------------------------------------------------------------------------------------------------------
class(burgers), intent(IN) :: self !< Burgers field.
real(R_P), intent(IN) :: CFL !< Courant-Friedricks-Lewi stability coefficient.
real(R_P) :: dt !< Current time step.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
dt = CFL * self%h**2 / self%nu
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction compute_dt