| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(circulator_t), | intent(inout) | :: | me | |||
| type(derivatives_involving_both_branches_t), | intent(out) | :: | deriv_wr_both_br |
subroutine mdot_derivatives(me,deriv_wr_both_br) type(circulator_t), intent(inout) :: me type(derivatives_involving_both_branches_t), intent(out) :: deriv_wr_both_br real(dp) :: dPres,dMdotdPin,dMdotdPout real(dp), dimension(Nb_VarC) :: dPindUin,dPoutdUout real(dp) :: kk, KKK, dedT, dPdT, HH, dPde if(me%SubType=="pump") then deriv_wr_both_br%DerMdotDerUin(:)=0.0_dp deriv_wr_both_br%DerMdotDerUout(:)=0.0_dp else if(me%SubType=="compressor") then dPres=me%br(2)%p%Prim(Pri_P)-me%br(1)%p%Prim(Pri_P) if(dPres<=0.0_dp) then deriv_wr_both_br%DerMdotDerUin(:)=0.0_dp deriv_wr_both_br%DerMdotDerUout(:)=0.0_dp else if(dPres>=me%dp0) then deriv_wr_both_br%DerMdotDerUin(:)=0.0_dp deriv_wr_both_br%DerMdotDerUout(:)=0.0_dp else dMdotdPin=2.0_dp*me%mdot0*dPres/(me%dp0**2) dMdotdPout=-2.0_dp*me%mdot0*dPres/(me%dp0**2) if(R_Correction) then dPindUin(1)=-0.5_dp*(me%br(1)%p%Cons(Con_Qdm)**2)/(me%br(1)%p%Cons(Con_Mas)**2) dPindUin(2)=me%br(1)%p%Cons(Con_Qdm)/me%br(1)%p%Cons(Con_Mas) dPindUin(3)=-1.0_dp dPindUin(4)=1.0_dp dPoutdUout(1)=-0.5_dp*(me%br(2)%p%Cons(Con_Qdm)**2)/(me%br(2)%p%Cons(Con_Mas)**2) dPoutdUout(2)=me%br(2)%p%Cons(Con_Qdm)/me%br(2)%p%Cons(Con_Mas) dPoutdUout(3)=-1.0_dp dPoutdUout(4)=1.0_dp else HH=me%br(1)%p%Prim(Pri_e)+me%br(1)%p%Prim(Pri_P)/me%br(1)%p%Prim(Pri_ro)+0.5_dp*me%br(1)%p%Prim(Pri_u)**2 call jacobian_roT(me%br(1)%p%Prim(Pri_ro), me%br(1)%p%Prim(Pri_T), dedT, dPdT) dPde=dPdT/dedT kk=dPde/me%br(1)%p%Prim(Pri_ro) KKK=me%br(1)%p%Prim(Pri_c)**2+kk*(me%br(1)%p%Prim(Pri_u)**2-HH) dPindUin(1)=KKK dPindUin(2)=-kk*me%br(1)%p%Prim(Pri_u) dPindUin(3)=kk dPindUin(4)=0.0_dp HH=me%br(2)%p%Prim(Pri_e)+me%br(2)%p%Prim(Pri_P)/me%br(2)%p%Prim(Pri_ro)+0.5_dp*me%br(2)%p%Prim(Pri_u)**2 call jacobian_roT(me%br(2)%p%Prim(Pri_ro), me%br(2)%p%Prim(Pri_T), dedT, dPdT) dPde=dPdT/dedT kk=dPde/me%br(2)%p%Prim(Pri_ro) KKK=me%br(2)%p%Prim(Pri_c)**2+kk*(me%br(2)%p%Prim(Pri_u)**2-HH) dPoutdUout(1)=KKK dPoutdUout(2)=-kk*me%br(2)%p%Prim(Pri_u) dPoutdUout(3)=kk dPoutdUout(4)=0.0_dp endif deriv_wr_both_br%DerMdotDerUin(:)=dMdotdPin*dPindUin(:) deriv_wr_both_br%DerMdotDerUout(:)=dMdotdPout*dPoutdUout(:) endif endif end subroutine mdot_derivatives