circulator_resolution_from_and_to_ports Subroutine

public subroutine circulator_resolution_from_and_to_ports(me)

Arguments

Type IntentOptional Attributes Name
type(circulator_t), intent(inout) :: me

Calls

proc~~circulator_resolution_from_and_to_ports~~CallsGraph proc~circulator_resolution_from_and_to_ports circulator_resolution_from_and_to_ports proc~imposed_mass_flow_rate imposed_mass_flow_rate proc~circulator_resolution_from_and_to_ports->proc~imposed_mass_flow_rate proc~incoming_branch_cold_circulator incoming_branch_cold_circulator proc~circulator_resolution_from_and_to_ports->proc~incoming_branch_cold_circulator proc~mdot_derivatives mdot_derivatives proc~circulator_resolution_from_and_to_ports->proc~mdot_derivatives proc~outgoing_branch_cold_circulator outgoing_branch_cold_circulator proc~circulator_resolution_from_and_to_ports->proc~outgoing_branch_cold_circulator proc~hhh_derivatives HHH_derivatives proc~incoming_branch_cold_circulator->proc~hhh_derivatives proc~imposed_compression_energy imposed_compression_energy proc~incoming_branch_cold_circulator->proc~imposed_compression_energy proc~jacobian_rot jacobian_roT proc~incoming_branch_cold_circulator->proc~jacobian_rot proc~jacobian_star jacobian_star proc~incoming_branch_cold_circulator->proc~jacobian_star proc~jacobian_star_req_rem jacobian_star_Req_rem proc~incoming_branch_cold_circulator->proc~jacobian_star_req_rem proc~state_rop state_roP proc~incoming_branch_cold_circulator->proc~state_rop proc~mdot_derivatives->proc~jacobian_rot proc~circulator_dynamic_parameters_df circulator_dynamic_parameters_t%circulator_dynamic_parameters_df proc~outgoing_branch_cold_circulator->proc~circulator_dynamic_parameters_df proc~circulator_dynamic_parameters_f circulator_dynamic_parameters_t%circulator_dynamic_parameters_f proc~outgoing_branch_cold_circulator->proc~circulator_dynamic_parameters_f proc~dc2_rot dc2_roT proc~outgoing_branch_cold_circulator->proc~dc2_rot proc~outgoing_branch_cold_circulator->proc~jacobian_rot proc~outgoing_branch_cold_circulator->proc~jacobian_star proc~outgoing_branch_cold_circulator->proc~jacobian_star_req_rem proc~set_error set_error proc~outgoing_branch_cold_circulator->proc~set_error proc~outgoing_branch_cold_circulator->proc~state_rop proc~t_rop T_roP proc~outgoing_branch_cold_circulator->proc~t_rop proc~zero zero proc~outgoing_branch_cold_circulator->proc~zero proc~circulator_dynamic_parameters_df->proc~jacobian_rot proc~circulator_dynamic_parameters_df->proc~t_rop proc~circulator_dynamic_parameters_f->proc~state_rop proc~eos_terms eos_terms proc~dc2_rot->proc~eos_terms proc~hhh_derivatives->proc~jacobian_rot proc~jacobian_rot->proc~eos_terms proc~jacobian_star_req_rem->proc~jacobian_rot proc~state_rop->proc~jacobian_rot proc~state_rop->proc~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~zero->f proc~brent->proc~set_error proc~brent->proc~zero proc~brent->f proc~eos_terms->proc~fill_f_terms proc~eos_e_terms eos_e_terms proc~eos_terms->proc~eos_e_terms proc~fill_e_tpart fill_e_Tpart proc~eos_e_terms->proc~fill_e_tpart proc~fill_ff_terms fill_ff_terms proc~eos_e_terms->proc~fill_ff_terms proc~fill_e_tpart->proc~fill_g_dreg_terms

Called by

proc~~circulator_resolution_from_and_to_ports~~CalledByGraph proc~circulator_resolution_from_and_to_ports circulator_resolution_from_and_to_ports proc~main_loop main_loop proc~main_loop->proc~circulator_resolution_from_and_to_ports program~reims_p reims_p program~reims_p->proc~main_loop

Source Code

subroutine circulator_resolution_from_and_to_ports(me)
    type(circulator_t), intent(inout) :: me

    real(dp) :: Pin,Pout,dPres,mdot,VarIn,ssOut,ssIn
    type(flux_and_derivatives_for_cold_circulator_t) :: FluxIn,Fluxout
    type(derivatives_involving_both_branches_t) :: deriv_wr_both_br

    Pin=me%br(1)%p%Prim(Pri_P)
    Pout=me%br(2)%p%Prim(Pri_P)
    dPres=Pout-Pin

    if(me%SubType=="pump") then
        mdot=imposed_mass_flow_rate(me,dPres,me%mdot0)
    else
        mdot=imposed_mass_flow_rate(me,dPres,me%mdot0,me%dp0)
    endif

    call mdot_derivatives(me,deriv_wr_both_br)

    call incoming_branch_cold_circulator(me,mdot,dPres,VarIn,deriv_wr_both_br,ssIn,FluxIn)

    call outgoing_branch_cold_circulator(me,mdot,VarIn,deriv_wr_both_br,ssOut,Fluxout)
    if (sim_error > 0) return

    me%wave_time = min(me%br(1)%p%dxLoc/ssIn,me%br(2)%p%dxLoc/ssOut)

    me%br(1)%p%flx(:)=FluxIn%flx(:)
    me%br(1)%p%vit=FluxIn%vit
    me%br(1)%p%derFlx_derCon(:,:)=FluxIn%DerFlxdBr_a(:,:)
    me%br(1)%p%derVit_derCon(:)=FluxIn%DerVitdBr_a(:)

    me%in_DerFlxdBr_out(:,:)=FluxIn%DerFlxdBr_b(:,:)
    me%in_DerVitdBr_out(:)=FluxIn%DerVitdBr_b(:)

    me%br(2)%p%flx(:)=Fluxout%flx(:)
    me%br(2)%p%vit=Fluxout%vit
    me%br(2)%p%derFlx_derCon(:,:)=FluxOut%DerFlxdBr_b(:,:)
    me%br(2)%p%derVit_derCon(:)=FluxOut%DerVitdBr_b(:)

    me%out_DerFlxdBr_in(:,:)=FluxOut%DerFlxdBr_a(:,:)
    me%out_DerVitdBr_in(:)=FluxOut%DerVitdBr_a(:)
end subroutine circulator_resolution_from_and_to_ports