hcf_viscosity.F90 Source File


This file depends on

sourcefile~~hcf_viscosity.f90~~EfferentGraph sourcefile~hcf_viscosity.f90 hcf_viscosity.F90 sourcefile~hcf_interface.f90 hcf_interface.F90 sourcefile~hcf_viscosity.f90->sourcefile~hcf_interface.f90 sourcefile~core.f90 core.F90 sourcefile~hcf_interface.f90->sourcefile~core.f90 sourcefile~input.f90 input.F90 sourcefile~hcf_interface.f90->sourcefile~input.f90 sourcefile~allocate.f90 allocate.F90 sourcefile~core.f90->sourcefile~allocate.f90 sourcefile~check_range.f90 check_range.F90 sourcefile~core.f90->sourcefile~check_range.f90 sourcefile~deallocate.f90 deallocate.F90 sourcefile~core.f90->sourcefile~deallocate.f90 sourcefile~error.f90 error.F90 sourcefile~core.f90->sourcefile~error.f90 sourcefile~fortran_utils.f90 fortran_utils.F90 sourcefile~core.f90->sourcefile~fortran_utils.f90 sourcefile~string_utils.f90 string_utils.F90 sourcefile~core.f90->sourcefile~string_utils.f90 sourcefile~types.f90 types.F90 sourcefile~core.f90->sourcefile~types.f90 sourcefile~unique.f90 unique.F90 sourcefile~core.f90->sourcefile~unique.f90 sourcefile~vtk.f90 vtk.F90 sourcefile~core.f90->sourcefile~vtk.f90 sourcefile~vtk_constants.f90 vtk_constants.F90 sourcefile~core.f90->sourcefile~vtk_constants.f90 sourcefile~input_interface.f90 input_interface.F90 sourcefile~input.f90->sourcefile~input_interface.f90 sourcefile~allocate.f90->sourcefile~error.f90 sourcefile~deallocate.f90->sourcefile~error.f90 sourcefile~memory_stats_wrapper.f90 memory_stats_wrapper.F90 sourcefile~fortran_utils.f90->sourcefile~memory_stats_wrapper.f90 sourcefile~signal_flag_wrapper.f90 signal_flag_wrapper.F90 sourcefile~fortran_utils.f90->sourcefile~signal_flag_wrapper.f90 sourcefile~system_info_wrapper.f90 system_info_wrapper.F90 sourcefile~fortran_utils.f90->sourcefile~system_info_wrapper.f90 sourcefile~input_interface.f90->sourcefile~core.f90 sourcefile~project_settings.f90 project_settings.F90 sourcefile~input_interface.f90->sourcefile~project_settings.f90 sourcefile~string_utils.f90->sourcefile~allocate.f90 sourcefile~array.f90 array.F90 sourcefile~types.f90->sourcefile~array.f90 sourcefile~gauss.f90 gauss.F90 sourcefile~types.f90->sourcefile~gauss.f90 sourcefile~matrix.f90 matrix.F90 sourcefile~types.f90->sourcefile~matrix.f90 sourcefile~pointer.f90 pointer.F90 sourcefile~types.f90->sourcefile~pointer.f90 sourcefile~variable.f90 variable.F90 sourcefile~types.f90->sourcefile~variable.f90 sourcefile~vector.f90 vector.F90 sourcefile~types.f90->sourcefile~vector.f90 sourcefile~unique.f90->sourcefile~allocate.f90 sourcefile~vtk.f90->sourcefile~allocate.f90 sourcefile~vtk.f90->sourcefile~deallocate.f90 sourcefile~vtk.f90->sourcefile~types.f90 sourcefile~vtk.f90->sourcefile~unique.f90 sourcefile~vtk.f90->sourcefile~vtk_constants.f90 sourcefile~vtk_wrapper.f90 vtk_wrapper.F90 sourcefile~vtk.f90->sourcefile~vtk_wrapper.f90 sourcefile~vtu_wrapper.f90 vtu_wrapper.F90 sourcefile~vtk.f90->sourcefile~vtu_wrapper.f90 sourcefile~array.f90->sourcefile~allocate.f90 sourcefile~array.f90->sourcefile~deallocate.f90 sourcefile~matrix_coo.f90 matrix_coo.F90 sourcefile~matrix.f90->sourcefile~matrix_coo.f90 sourcefile~matrix_crs.f90 matrix_crs.F90 sourcefile~matrix.f90->sourcefile~matrix_crs.f90 sourcefile~matrix_dense.f90 matrix_dense.F90 sourcefile~matrix.f90->sourcefile~matrix_dense.f90 sourcefile~matrix_interface.f90 matrix_interface.F90 sourcefile~matrix.f90->sourcefile~matrix_interface.f90 sourcefile~c_utils.f90 c_utils.F90 sourcefile~memory_stats_wrapper.f90->sourcefile~c_utils.f90 sourcefile~project_settings.f90->sourcefile~core.f90 sourcefile~signal_flag.f90 signal_flag.F90 sourcefile~signal_flag_wrapper.f90->sourcefile~signal_flag.f90 sourcefile~system_info_wrapper.f90->sourcefile~c_utils.f90 sourcefile~variable.f90->sourcefile~allocate.f90 sourcefile~c_utils.f90->sourcefile~signal_flag.f90 sourcefile~memory_stats.f90 memory_stats.F90 sourcefile~c_utils.f90->sourcefile~memory_stats.f90 sourcefile~system_info.f90 system_info.F90 sourcefile~c_utils.f90->sourcefile~system_info.f90 sourcefile~matrix_coo.f90->sourcefile~allocate.f90 sourcefile~matrix_coo.f90->sourcefile~deallocate.f90 sourcefile~matrix_coo.f90->sourcefile~matrix_interface.f90 sourcefile~matrix_crs.f90->sourcefile~allocate.f90 sourcefile~matrix_crs.f90->sourcefile~deallocate.f90 sourcefile~matrix_crs.f90->sourcefile~matrix_interface.f90 sourcefile~matrix_dense.f90->sourcefile~allocate.f90 sourcefile~matrix_dense.f90->sourcefile~deallocate.f90 sourcefile~matrix_dense.f90->sourcefile~matrix_interface.f90

Source Code

submodule(calculate_hcf) calculate_hcf_viscosity
    implicit none
contains
    !----------------------------------------------------------------------------------------------------
    ! Constructe the type
    !----------------------------------------------------------------------------------------------------
    module function construct_type_hcf_viscosity(water_viscosity_model) result(structure)
        implicit none
        integer(int32), intent(in) :: water_viscosity_model
        class(abst_hcf_viscosity), allocatable :: structure

        if (allocated(structure)) deallocate (structure)

        select case (water_viscosity_model)
        case (1)
            allocate (type_hcf_viscosity_exp :: structure)
        case (2)
            allocate (type_hcf_viscosity_supercool :: structure)
        end select

        select type (this => structure)
        type is (type_hcf_viscosity_exp)
            this%mu_zero = this%calc_viscosity(15.0d0)
        type is (type_hcf_viscosity_supercool)
            this%mu_zero = this%calc_viscosity(15.0d0)
        end select

    end function construct_type_hcf_viscosity

    !----------------------------------------------------------------------------------------------------
    ! Calculate water viscosity depending on the temperature
    !----------------------------------------------------------------------------------------------------
    module pure elemental function calc_viscosity_exp(self, temperature) result(kr)
        implicit none
        class(type_hcf_viscosity_exp), intent(in) :: self
        real(real64), intent(in) :: temperature
        real(real64) :: kr

        kr = self%mu_zero / calc_mu_exponential(temperature)

    end function calc_viscosity_exp

    module pure elemental function calc_viscosity_supercool(self, temperature) result(kr)
        implicit none
        class(type_hcf_viscosity_supercool), intent(in) :: self
        real(real64), intent(in) :: temperature
        real(real64) :: kr

        kr = self%mu_zero / calc_mu_exponential_supercooled(temperature)

    end function calc_viscosity_supercool

    pure elemental function calc_mu_exponential(temperature) result(viscosity)
        implicit none
        real(real64), intent(in) :: temperature
        real(real64) :: viscosity

        viscosity = 2.1d-6 * exp(1808.5d0 / (temperature + 273.15d0))

    end function calc_mu_exponential

    pure elemental function calc_mu_exponential_supercooled(temperature) result(viscosity)
        implicit none
        real(real64), intent(in) :: temperature
        real(real64) :: viscosity

        viscosity = 1.3788d-4 * ((273.15d0 + temperature) / 225.66d0 - 1.0d0)**(-1.6438d0)

    end function calc_mu_exponential_supercooled

end submodule calculate_hcf_viscosity