imposed_compression_energy Function

public function imposed_compression_energy(me, rostar, g, dPres, dp0)

Arguments

Type IntentOptional Attributes Name
type(circulator_t), intent(inout) :: me
real(kind=dp), intent(in) :: rostar
real(kind=dp), intent(in) :: g
real(kind=dp), intent(in) :: dPres
real(kind=dp), intent(in) :: dp0

Return Value real(kind=dp)


Called by

proc~~imposed_compression_energy~~CalledByGraph proc~imposed_compression_energy imposed_compression_energy proc~incoming_branch_cold_circulator incoming_branch_cold_circulator proc~incoming_branch_cold_circulator->proc~imposed_compression_energy proc~circulator_resolution_from_and_to_ports circulator_resolution_from_and_to_ports proc~circulator_resolution_from_and_to_ports->proc~incoming_branch_cold_circulator 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

function imposed_compression_energy(me,rostar,g,dPres,dp0)
    type(circulator_t), intent(inout) :: me
    real(dp), intent(in) :: rostar,g,dPres,dp0
    real(dp) :: imposed_compression_energy,eps,Ro_a,Ro_b
    
    if(me%SubType=="pump") then
        Ro_a=me%br(1)%p%Prim(Pri_ro)
        Ro_b=me%br(2)%p%Prim(Pri_ro)
        imposed_compression_energy=0.5_dp*(1.0_dp/Ro_a+1.0_dp/Ro_b)*dPres
    else if(me%SubType=="compressor") then
        eps=1.0e-3_dp  
        if(dPres<=0.0_dp) then
            imposed_compression_energy=dp0/(rostar*g)
        else if(dPres>=dp0) then
            imposed_compression_energy=eps*dp0/(rostar*g) !0.0_dp
        else
            imposed_compression_energy=dp0*(1.0_dp-(dPres/dp0)**2)/(rostar*g)
        endif
    endif
end function imposed_compression_energy