properties_manager.F90 Source File


This file depends on

sourcefile~~properties_manager.f90~~EfferentGraph sourcefile~properties_manager.f90 properties_manager.F90 sourcefile~calculate.f90 calculate.F90 sourcefile~properties_manager.f90->sourcefile~calculate.f90 sourcefile~core.f90 core.F90 sourcefile~properties_manager.f90->sourcefile~core.f90 sourcefile~input.f90 input.F90 sourcefile~properties_manager.f90->sourcefile~input.f90 sourcefile~materials_manager.f90 materials_manager.F90 sourcefile~properties_manager.f90->sourcefile~materials_manager.f90 sourcefile~density_interface.f90 density_interface.F90 sourcefile~calculate.f90->sourcefile~density_interface.f90 sourcefile~gcc_interface.f90 gcc_interface.F90 sourcefile~calculate.f90->sourcefile~gcc_interface.f90 sourcefile~heat_capacity_interface.f90 heat_capacity_interface.F90 sourcefile~calculate.f90->sourcefile~heat_capacity_interface.f90 sourcefile~specific_heat_interface.f90 specific_heat_interface.F90 sourcefile~calculate.f90->sourcefile~specific_heat_interface.f90 sourcefile~thermal_conductivity_interface.f90 thermal_conductivity_interface.F90 sourcefile~calculate.f90->sourcefile~thermal_conductivity_interface.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~materials_manager.f90->sourcefile~calculate.f90 sourcefile~materials_manager.f90->sourcefile~input.f90 sourcefile~allocate.f90->sourcefile~error.f90 sourcefile~deallocate.f90->sourcefile~error.f90 sourcefile~density_interface.f90->sourcefile~core.f90 sourcefile~density_interface.f90->sourcefile~input.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~gcc_interface.f90->sourcefile~input.f90 sourcefile~heat_capacity_interface.f90->sourcefile~core.f90 sourcefile~heat_capacity_interface.f90->sourcefile~density_interface.f90 sourcefile~heat_capacity_interface.f90->sourcefile~input_interface.f90 sourcefile~input_interface.f90->sourcefile~core.f90 sourcefile~project_settings.f90 project_settings.F90 sourcefile~input_interface.f90->sourcefile~project_settings.f90 sourcefile~specific_heat_interface.f90->sourcefile~core.f90 sourcefile~specific_heat_interface.f90->sourcefile~input.f90 sourcefile~string_utils.f90->sourcefile~allocate.f90 sourcefile~thermal_conductivity_interface.f90->sourcefile~core.f90 sourcefile~thermal_conductivity_interface.f90->sourcefile~input.f90 sourcefile~array.f90 array.F90 sourcefile~types.f90->sourcefile~array.f90 sourcefile~gauss.f90 gauss.F90 sourcefile~types.f90->sourcefile~gauss.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~unique.f90 sourcefile~vtk.f90->sourcefile~vtk_constants.f90 sourcefile~vtk.f90->sourcefile~array.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~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

Files dependent on this one

sourcefile~~properties_manager.f90~~AfferentGraph sourcefile~properties_manager.f90 properties_manager.F90 sourcefile~properties.f90 properties.F90 sourcefile~properties.f90->sourcefile~properties_manager.f90 sourcefile~ftdss.f90 ftdss.F90 sourcefile~ftdss.f90->sourcefile~properties.f90 sourcefile~thermal_interface.f90 thermal_interface.F90 sourcefile~ftdss.f90->sourcefile~thermal_interface.f90 sourcefile~output.f90 output.F90 sourcefile~ftdss.f90->sourcefile~output.f90 sourcefile~output_interface.f90 output_interface.F90 sourcefile~output_interface.f90->sourcefile~properties.f90 sourcefile~thermal_interface.f90->sourcefile~properties.f90 sourcefile~output.f90->sourcefile~output_interface.f90 sourcefile~output_base.f90 output_base.F90 sourcefile~output_base.f90->sourcefile~output_interface.f90 sourcefile~output_observation.f90 output_observation.F90 sourcefile~output_observation.f90->sourcefile~output_interface.f90 sourcefile~output_overall_base.f90 output_overall_base.F90 sourcefile~output_overall_base.f90->sourcefile~output_interface.f90 sourcefile~output_overall_vtk.f90 output_overall_vtk.F90 sourcefile~output_overall_vtk.f90->sourcefile~output_interface.f90 sourcefile~output_overall_vtu.f90 output_overall_vtu.F90 sourcefile~output_overall_vtu.f90->sourcefile~output_interface.f90 sourcefile~output_system_logger.f90 output_system_logger.F90 sourcefile~output_system_logger.f90->sourcefile~output_interface.f90 sourcefile~thermal.f90 thermal.F90 sourcefile~thermal.f90->sourcefile~thermal_interface.f90 sourcefile~thermal_3phase.f90 thermal_3phase.F90 sourcefile~thermal_3phase.f90->sourcefile~thermal_interface.f90

Source Code

module properties_properties_manager
    use, intrinsic :: iso_fortran_env, only: int32, real64
    use :: module_core, only:type_gauss_point_state
    use :: module_input
    use :: module_calculate, only:holder_gccs, holder_wrfs, holder_dens, holder_vhcs, holder_thcs, & !&
                                        abst_gcc, abst_wrf, abst_den, abst_vhc, abst_thc
    use :: Properties_material_Manager, only:type_material_manager

    implicit none
    private
    public :: type_proereties_manager

    type :: type_proereties_manager
        type(type_material_manager) :: materials
        procedure(abst_get_value), pointer, pass(self) :: get_thc => null()
        procedure(abst_get_value), pointer, pass(self) :: get_vhc => null()
        ! procedure(abst_get_value), pointer, pass(self) :: get_dCa_dT => null()
        procedure(abst_get_value), pointer, pass(self) :: get_qw => null()
    contains
        procedure, pass(self) :: initialize => type_proereties_manager_initialize
    end type

    abstract interface
        function abst_get_value(self, state, region_id) result(val)
            import :: type_proereties_manager, type_gauss_point_state, int32, real64
            implicit none
            class(type_proereties_manager), intent(inout) :: self
            type(type_gauss_point_state), intent(in) :: state
            integer(int32), intent(in) :: region_id
            real(real64) :: val
        end function abst_get_value
    end interface

contains

    subroutine type_proereties_manager_initialize(self, Input, ierr)
        implicit none
        class(type_proereties_manager), intent(inout) :: self
        type(Type_Input), intent(in) :: Input
        integer(int32), intent(inout) :: ierr

        logical :: is_ptr = .true.

        ! Initialize the materials manager
        call self%materials%initialize(Input, ierr)

        if (ierr /= 0) then
            print *, "Error initializing materials manager."
            return
        end if

        if (is_ptr) then
            self%get_thc => calculate_thc_ptr
            self%get_vhc => calculate_heat_capacity_ptr
            ! self%get_dCa_dT => calculate_dcdt_ptr
            self%get_qw => calculate_water_content_ptr
        else
            self%get_thc => calculate_thc_holder
            self%get_vhc => calculate_heat_capacity_holder
            ! self%get_dCa_dT => calculate_dcdt_holder
            self%get_qw => calculate_water_content_holder
        end if

    end subroutine type_proereties_manager_initialize

    function calculate_thc_holder(self, state, region_id) result(val)
        implicit none
        class(type_proereties_manager), intent(inout) :: self
        type(type_gauss_point_state), intent(in) :: state
        integer(int32), intent(in) :: region_id
        real(real64) :: val

        type(holder_thcs) :: holder_thc

        call self%materials%get_THC(region_id, holder_thc)
        val = holder_thc%p%calc_gauss_point(state)

    end function calculate_thc_holder

    function calculate_thc_ptr(self, state, region_id) result(val)
        implicit none
        class(type_proereties_manager), intent(inout) :: self
        type(type_gauss_point_state), intent(in) :: state
        integer(int32), intent(in) :: region_id
        real(real64) :: val

        class(abst_thc), pointer :: local_thc

        call self%materials%get_THC(region_id, local_thc)

        val = local_thc%calc_gauss_point(state)

    end function calculate_thc_ptr

    function calculate_heat_capacity_holder(self, state, region_id) result(val)
        implicit none
        class(type_proereties_manager), intent(inout) :: self
        type(type_gauss_point_state), intent(in) :: state
        integer(int32), intent(in) :: region_id
        real(real64) :: val

        real(real64) :: Lf, dQi_dT

        type(holder_vhcs) :: holder_vhc
        type(holder_gccs) :: holder_gcc
        type(holder_dens) :: holder_den
        type(holder_wrfs) :: holder_wrf

        call self%materials%get_vhc(region_id, holder_vhc)
        call self%materials%get_den(region_id, holder_den)
        call self%materials%get_gcc(region_id, holder_gcc)
        call self%materials%get_wrf(region_id, holder_wrf)

        Lf = holder_gcc%p%Lf
        dQi_dT = holder_wrf%p%deriv(-holder_gcc%p%calc(T=state%temperature, &
                                                       Pw=state%pressure, &
                                                       rhoW=holder_den%p%material2, &
                                                       rhoI=holder_den%p%material3)) &
                 * holder_gcc%p%deriv(T=state%temperature, &
                                      Pw=state%pressure, &
                                      rhoW=holder_den%p%material2, &
                                      rhoI=holder_den%p%material3)

        val = holder_vhc%p%calc_gauss_point_holder(state=state, &
                                                   DEN=holder_den, &
                                                   LatentHeat=Lf, &
                                                   dQi_dT=dQi_dT)

    end function calculate_heat_capacity_holder

    function calculate_heat_capacity_ptr(self, state, region_id) result(val)
        implicit none
        class(type_proereties_manager), intent(inout) :: self
        type(type_gauss_point_state), intent(in) :: state
        integer(int32), intent(in) :: region_id
        real(real64) :: val

        class(abst_gcc), pointer :: local_gcc
        class(abst_wrf), pointer :: local_wrf
        class(abst_den), pointer :: local_den
        class(abst_vhc), pointer :: local_vhc

        call self%materials%get_gcc(region_id, local_gcc)
        call self%materials%get_wrf(region_id, local_wrf)
        call self%materials%get_den(region_id, local_den)
        call self%materials%get_vhc(region_id, local_vhc)

        val = local_vhc%calc_gauss_point_ptr(state=state, &
                                             DEN=local_den, &
                                             LatentHeat=local_gcc%Lf, &
                                             dQi_dT=local_wrf%deriv(-local_gcc%calc(T=state%temperature, &
                                                                                    Pw=state%pressure, &
                                                                                    rhoW=local_den%material2, &
                                                                                    rhoI=local_den%material3)))

    end function calculate_heat_capacity_ptr

    ! function calculate_dcdt(self, state, region_id) result(dCa_dT)
    !     implicit none
    !     class(type_proereties_manager), intent(in) :: self
    !     type(type_gauss_point_state), intent(in) :: state
    !     integer(int32), intent(in) :: region_id
    !     real(real64) :: dCa_dT
    !     ! ... 熱容量の温度微分を計算 ...
    ! end function

    function calculate_water_content_holder(self, state, region_id) result(val)
        implicit none
        class(type_proereties_manager), intent(inout) :: self
        type(type_gauss_point_state), intent(in) :: state
        integer(int32), intent(in) :: region_id
        real(real64) :: val

        type(holder_gccs) :: holder_gcc
        type(holder_wrfs) :: holder_wrf
        type(holder_dens) :: holder_den

        call self%materials%get_gcc(region_id, holder_gcc)
        call self%materials%get_wrf(region_id, holder_wrf)
        call self%materials%get_den(region_id, holder_den)

        ! ... 水分量の計算ロジックをここに追加 ...
        val = holder_wrf%p%calc(-holder_gcc%p%calc(T=state%temperature, &
                                                   Pw=state%pressure, &
                                                   rhoW=holder_den%p%material2, &
                                                   rhoI=holder_den%p%material3))
    end function calculate_water_content_holder

    function calculate_water_content_ptr(self, state, region_id) result(val)
        implicit none
        class(type_proereties_manager), intent(inout) :: self
        type(type_gauss_point_state), intent(in) :: state
        integer(int32), intent(in) :: region_id
        real(real64) :: val

        class(abst_gcc), pointer :: local_gcc
        class(abst_wrf), pointer :: local_wrf
        class(abst_den), pointer :: local_den

        call self%materials%get_gcc(region_id, local_gcc)
        call self%materials%get_wrf(region_id, local_wrf)
        call self%materials%get_den(region_id, local_den)

        ! ... 水分量の計算ロジックをここに追加 ...
        val = -local_wrf%calc(-local_gcc%calc(T=state%temperature, &
                                              Pw=state%pressure, &
                                              rhoW=local_den%material2, &
                                              rhoI=local_den%material3))
    end function calculate_water_content_ptr

end module properties_properties_manager