full_physics_definition_channel Subroutine

public subroutine full_physics_definition_channel(me, sim)

Arguments

Type IntentOptional Attributes Name
type(channel_t), intent(inout) :: me
type(simulation_t), intent(in) :: sim

Calls

proc~~full_physics_definition_channel~~CallsGraph proc~full_physics_definition_channel full_physics_definition_channel proc~dc2_rot dc2_roT proc~full_physics_definition_channel->proc~dc2_rot proc~source_term_definition_channel source_term_definition_channel proc~full_physics_definition_channel->proc~source_term_definition_channel proc~eos_terms eos_terms proc~dc2_rot->proc~eos_terms proc~signal_v1d signal_t%signal_v1d proc~source_term_definition_channel->proc~signal_v1d proc~sourceterms_notfriction_channel SourceTerms_NOTfriction_channel proc~source_term_definition_channel->proc~sourceterms_notfriction_channel proc~eos_e_terms eos_e_terms proc~eos_terms->proc~eos_e_terms proc~fill_f_terms fill_f_terms proc~eos_terms->proc~fill_f_terms proc~he_prop he_prop proc~sourceterms_notfriction_channel->proc~he_prop proc~jacobian_rot jacobian_roT proc~sourceterms_notfriction_channel->proc~jacobian_rot proc~nusselt_correlation nusselt_t%nusselt_correlation proc~sourceterms_notfriction_channel->proc~nusselt_correlation proc~nusselt_correlation_der_pra nusselt_t%nusselt_correlation_der_Pra proc~sourceterms_notfriction_channel->proc~nusselt_correlation_der_pra proc~nusselt_correlation_der_re nusselt_t%nusselt_correlation_der_Re proc~sourceterms_notfriction_channel->proc~nusselt_correlation_der_re proc~nusselt_correlation_der_t nusselt_t%nusselt_correlation_der_T proc~sourceterms_notfriction_channel->proc~nusselt_correlation_der_t proc~state_roe state_roE proc~sourceterms_notfriction_channel->proc~state_roe proc~state_roe_withr state_roE_withR proc~sourceterms_notfriction_channel->proc~state_roe_withr 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~he_prop->proc~jacobian_rot proc~set_error set_error proc~he_prop->proc~set_error proc~jacobian_rot->proc~eos_terms proc~state_roe->proc~jacobian_rot proc~t_roe T_roE proc~state_roe->proc~t_roe proc~state_roe_withr->proc~jacobian_rot proc~t_rop T_roP proc~state_roe_withr->proc~t_rop proc~fill_g_dreg_terms fill_g_Dreg_terms proc~fill_e_tpart->proc~fill_g_dreg_terms proc~t_roe->proc~fill_e_tpart proc~t_roe->proc~fill_ff_terms proc~brent brent proc~t_roe->proc~brent proc~t_rop->proc~fill_f_terms proc~t_rop->proc~brent proc~t_rop->proc~fill_g_dreg_terms proc~brent->proc~set_error f f proc~brent->f proc~zero zero proc~brent->proc~zero proc~zero->f

Called by

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

Source Code

subroutine full_physics_definition_channel(me,sim)
    type(channel_t),       intent(inout) :: me
    type(simulation_t), intent(in)    :: sim

      real(dp) :: wwn    
      real(dp) :: Varcentree_i,Varcentree_iplus !! Centered variable ro c2
      real(dp), dimension(Nb_VarC) :: DerVarcentree
      real(dp), dimension(Nb_VarC) :: dcSQ
      real(dp), dimension(Nb_VarC) :: DerRodUi
      real(dp) :: dcSQdro,dcSQdp,dxloc,dxlocA
      integer :: i,NbCells

      wwn = sim%dt/sim%dtPrev1
      me%big%amx=0.0_dp;me%big%bmx=0.0_dp;me%big%cmx=0.0_dp;me%big%bvx=0.0_dp
  
      DerRodUi(:)=0.0_dp
      DerRodUi(Con_Mas)=1.0_dp

      NbCells=me%HeProp%NbCells
  
      do i=1,NbCells

        dxloc=me%HeProp%dxloc(i)
        if(i/=NbCells) dxlocA=me%HeProp%dxloc(i+1)

        if(i/=NbCells) me%big%amx(:,:,i)=-(sim%dt/dxlocA)*(me%flxHe%Cons_DerdUL(:,:,i)) ! 1st element --> cell 2
        me%big%bmx(:,:,i)=id_4x4(:,:)+(sim%dt/dxloc)*(me%flxHe%Cons_DerdUL(:,:,i)-&
                                     me%flxHe%Cons_DerdUR(:,:,i-1))
        if(i/=NbCells) me%big%cmx(:,:,i)=(sim%dt/dxloc)*me%flxHe%Cons_DerdUR(:,:,i)   

        me%big%bvx(1:Nb_VarC,i)=-(sim%dt/dxloc)*(me%flxHe%Cons(:,i)-me%flxHe%Cons(:,i-1))
        
        ! Correction with non-conservative terms      
        if(R_Correction) then
          call dc2_roT(me%StVar%He_pr(Pri_ro,i), me%StVar%He_pr(Pri_T,i), dcSQdro, dcSQdp)

          dcSQ(Con_Mas)=dcSQdro-0.5_dp*dcSQdp*(me%StVar%He_cs(Con_Qdm,i)**2)/(me%StVar%He_cs(Con_Mas,i)**2)
          dcSQ(Con_Qdm)=dcSQdp*me%StVar%He_cs(Con_Qdm,i)/me%StVar%He_cs(Con_Mas,i)
          dcSQ(Con_Ene)=-dcSQdp
          dcSQ(Con_R)=dcSQdp

          Varcentree_i=me%StVar%He_pr(Pri_ro,i)*(me%StVar%He_pr(Pri_c,i)**2)
          if(i/=NbCells) Varcentree_iplus=me%StVar%He_pr(Pri_ro,i+1)*(me%StVar%He_pr(Pri_c,i+1)**2)
          DerVarcentree(:)=DerRodUi(:)*(me%StVar%He_pr(Pri_c,i)**2)+me%StVar%He_pr(Pri_ro,i)*dcSQ(:)
        else    
          Varcentree_i=0.0_dp
          if(i/=NbCells) Varcentree_iplus=0.0_dp
          DerVarcentree(:)=0.0_dp
        endif
    
        if(i/=NbCells) me%big%amx(1:Nb_VarC,Con_R,i)=me%big%amx(1:Nb_VarC,Con_R,i)-(sim%dt/dxlocA)*Varcentree_iplus*&
                                                         me%flxHe%VitTNC_DerdUL(:,i)
        me%big%bmx(1:Nb_VarC,Con_R,i)=me%big%bmx(1:Nb_VarC,Con_R,i)+(sim%dt/dxloc)*(Varcentree_i*&
                                           (me%flxHe%VitTNC_DerdUL(:,i)-me%flxHe%VitTNC_DerdUR(:,i-1))+&
                                           (me%flxHe%VitTNC(i)-me%flxHe%VitTNC(i-1))*DerVarcentree(:))
        if(i/=NbCells) me%big%cmx(1:Nb_VarC,Con_R,i)=me%big%cmx(1:Nb_VarC,Con_R,i)+(sim%dt/dxloc)*Varcentree_i*&
                                                          me%flxHe%VitTNC_DerdUR(:,i)
        me%big%bvx(Con_R,i)=me%big%bvx(Con_R,i)-(sim%dt/dxloc)*Varcentree_i*(me%flxHe%VitTNC(i)-&
                                 me%flxHe%VitTNC(i-1))                 

      enddo

      call source_term_definition_channel(me,sim)
    
      do i=1,NbCells
        ! Modification of the diagonal terms 
          me%big%bmx(1:Nb_VarC,1:Nb_VarC,i)=me%big%bmx(1:Nb_VarC,1:Nb_VarC,i)-id_4x4(:,:)+&
                                                 ((1.0_dp+2.0_dp*wwn)/(1.0_dp+wwn))*id_4x4(:,:)
          
        ! Modification of the vector B by adding time step n-1 contribution
          me%big%bvx(1:Nb_VarC,i)=me%big%bvx(1:Nb_VarC,i)+((wwn**2)/(1.0_dp+wwn))*&
                                       (me%StVar%He_cs(:,i)-me%StVarOld2%He_cs(:,i))
      enddo

end subroutine full_physics_definition_channel