T_roP Function

public function T_roP(ro, p) result(T)

Solve p(ro,T) = p for T.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: ro
real(kind=dp), intent(in) :: p

Return Value real(kind=dp)


Calls

proc~~t_rop~~CallsGraph proc~t_rop T_roP proc~brent brent proc~t_rop->proc~brent proc~fill_f_terms fill_f_terms proc~t_rop->proc~fill_f_terms proc~fill_g_dreg_terms fill_g_Dreg_terms proc~t_rop->proc~fill_g_dreg_terms f f proc~brent->f proc~set_error set_error proc~brent->proc~set_error proc~zero zero proc~brent->proc~zero proc~zero->f

Called by

proc~~t_rop~~CalledByGraph proc~t_rop T_roP proc~circulator_dynamic_parameters_df circulator_dynamic_parameters_t%circulator_dynamic_parameters_df proc~circulator_dynamic_parameters_df->proc~t_rop proc~derivative_function_of_pstar_pt derivative_function_of_pstar_PT proc~derivative_function_of_pstar_pt->proc~t_rop proc~droeint_drop droeint_droP proc~droeint_drop->proc~t_rop proc~ffsrclink_prelax_resolution_from_and_to_ports FFsrcLink_Prelax_resolution_from_and_to_ports proc~ffsrclink_prelax_resolution_from_and_to_ports->proc~t_rop proc~function_of_pstar_mt function_of_pstar_MT proc~function_of_pstar_mt->proc~t_rop proc~outgoing_branch_cold_circulator outgoing_branch_cold_circulator proc~outgoing_branch_cold_circulator->proc~t_rop proc~outgoing_branch_cold_circulator->proc~circulator_dynamic_parameters_df proc~state_rop state_roP proc~outgoing_branch_cold_circulator->proc~state_rop proc~circulator_dynamic_parameters_f circulator_dynamic_parameters_t%circulator_dynamic_parameters_f proc~outgoing_branch_cold_circulator->proc~circulator_dynamic_parameters_f proc~solve_boundary_mt solve_boundary_MT proc~solve_boundary_mt->proc~t_rop proc~solve_boundary_mt->proc~function_of_pstar_mt proc~solve_boundary_mt->proc~state_rop proc~state_roe_withr state_roE_withR proc~state_roe_withr->proc~t_rop proc~state_rop->proc~t_rop proc~state_rop_withr state_roP_withR proc~state_rop_withr->proc~t_rop proc~boundary_resolution_from_and_to_ports boundary_resolution_from_and_to_ports proc~boundary_resolution_from_and_to_ports->proc~solve_boundary_mt proc~solve_boundary_pt solve_boundary_PT proc~boundary_resolution_from_and_to_ports->proc~solve_boundary_pt proc~circulator_dynamic_parameters_f->proc~state_rop proc~circulator_resolution_from_and_to_ports circulator_resolution_from_and_to_ports proc~circulator_resolution_from_and_to_ports->proc~outgoing_branch_cold_circulator proc~incoming_branch_cold_circulator incoming_branch_cold_circulator proc~circulator_resolution_from_and_to_ports->proc~incoming_branch_cold_circulator proc~friction_source_term friction_source_term proc~friction_source_term->proc~state_roe_withr proc~from_sol_to_prim_channel from_sol_to_prim_channel proc~from_sol_to_prim_channel->proc~state_roe_withr proc~function_of_pstar_pt function_of_pstar_PT proc~function_of_pstar_pt->proc~state_rop proc~hug_brent_f hug_brent_t%hug_brent_f proc~hug_brent_f->proc~droeint_drop proc~hugoniot_star_state hugoniot_star_state proc~hugoniot_star_state->proc~droeint_drop proc~incoming_branch_cold_circulator->proc~state_rop proc~junction_dynamic_parameters_fcn junction_dynamic_parameters_t%junction_dynamic_parameters_fcn proc~junction_dynamic_parameters_fcn->proc~droeint_drop proc~main_loop main_loop proc~main_loop->proc~ffsrclink_prelax_resolution_from_and_to_ports proc~main_loop->proc~boundary_resolution_from_and_to_ports proc~main_loop->proc~circulator_resolution_from_and_to_ports proc~main_loop->proc~friction_source_term proc~main_loop->proc~from_sol_to_prim_channel proc~junction_resolution_from_and_to_ports Junction_resolution_from_and_to_ports proc~main_loop->proc~junction_resolution_from_and_to_ports proc~source_term_definition_channel source_term_definition_channel proc~main_loop->proc~source_term_definition_channel proc~full_physics_definition_channel full_physics_definition_channel proc~main_loop->proc~full_physics_definition_channel proc~solve_boundary_pt->proc~derivative_function_of_pstar_pt proc~solve_boundary_pt->proc~state_rop proc~solve_boundary_pt->proc~state_rop_withr proc~solve_boundary_pt->proc~function_of_pstar_pt proc~solve_boundary_pt->proc~hugoniot_star_state proc~solve_junction solve_junction proc~solve_junction->proc~droeint_drop proc~solve_junction->proc~state_rop proc~sourceterms_notfriction_channel SourceTerms_NOTfriction_channel proc~sourceterms_notfriction_channel->proc~state_roe_withr proc~junction_resolution_from_and_to_ports->proc~solve_junction proc~source_term_definition_channel->proc~sourceterms_notfriction_channel program~reims_p reims_p program~reims_p->proc~main_loop proc~full_physics_definition_channel->proc~source_term_definition_channel

Source Code

function T_roP(ro, p) result(T)
    !! Solve p(ro,T) = p for T. 
    real(dp), intent(in) :: ro, p
    real(dp) :: T

    type(T_from_roP_obj_t) :: obj
    type(ThArrays_t) :: ThAr
    real(dp) :: ro_Arp, p_Arp
    real(dp) :: Funct, DerFunct
    logical  :: converged
    integer  :: ite

    ro_Arp = ro/(MolMass*1000.0_dp)
    p_Arp  = p*1.0e-6_dp
    obj%ro = ro_Arp
    obj%p  = p_Arp

    call fill_f_terms(ro_Arp, ThAr)

    T = Newton_T_guess0
    converged = .false.
    do ite = 1, Newton_MaxIte
        call fill_g_Dreg_terms(T, ThAr)
        Funct = p_Arp - ro_Arp*R_cte_gaz_Arp*T - sum(ThAr%f*ThAr%g)
        if (abs(Funct) <= Newton_FunctTol) then
            converged = .true.
            exit
        endif
        DerFunct = -ro_Arp*R_cte_gaz_Arp - sum(ThAr%f*ThAr%Derg)
        T = T - Funct/DerFunct
    enddo
    if (converged .and. T >= T_He_min .and. T <= T_He_max) return
    T = brent(obj, T_He_min, T_He_max, 'T_roP')
end function T_roP