full_physics_definition_strand Subroutine

public subroutine full_physics_definition_strand(me, sim, Qext_Check)

Arguments

Type IntentOptional Attributes Name
type(strand_t), intent(inout) :: me
type(simulation_t), intent(in) :: sim
real(kind=dp), intent(out), optional :: Qext_Check

Calls

proc~~full_physics_definition_strand~~CallsGraph proc~full_physics_definition_strand full_physics_definition_strand proc~material_critical_current_density material_t%material_critical_current_density proc~full_physics_definition_strand->proc~material_critical_current_density proc~material_critical_field material_t%material_critical_field proc~full_physics_definition_strand->proc~material_critical_field proc~material_critical_temperature material_t%material_critical_temperature proc~full_physics_definition_strand->proc~material_critical_temperature proc~material_current_sharing_temperature material_t%material_current_sharing_temperature proc~full_physics_definition_strand->proc~material_current_sharing_temperature proc~material_heat_capacity material_t%material_heat_capacity proc~full_physics_definition_strand->proc~material_heat_capacity proc~material_heat_capacity_der material_t%material_heat_capacity_der proc~full_physics_definition_strand->proc~material_heat_capacity_der proc~material_strain material_t%material_strain proc~full_physics_definition_strand->proc~material_strain proc~source_term_definition_strand source_term_definition_strand proc~full_physics_definition_strand->proc~source_term_definition_strand proc~solid_source_terms solid_source_terms proc~source_term_definition_strand->proc~solid_source_terms proc~solid_source_terms->proc~material_critical_current_density proc~solid_source_terms->proc~material_critical_field proc~solid_source_terms->proc~material_critical_temperature proc~solid_source_terms->proc~material_current_sharing_temperature proc~solid_source_terms->proc~material_heat_capacity proc~solid_source_terms->proc~material_heat_capacity_der proc~solid_source_terms->proc~material_strain proc~material_critical_current_density_der material_t%material_critical_current_density_der proc~solid_source_terms->proc~material_critical_current_density_der proc~material_resistivity material_t%material_resistivity proc~solid_source_terms->proc~material_resistivity proc~material_resistivity_der material_t%material_resistivity_der proc~solid_source_terms->proc~material_resistivity_der proc~set_error set_error proc~solid_source_terms->proc~set_error proc~supercond_current supercond_current proc~solid_source_terms->proc~supercond_current proc~supercond_current->proc~set_error float float proc~supercond_current->float

Called by

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

Source Code

subroutine full_physics_definition_strand(me,sim,Qext_Check)
    type(strand_t),     intent(inout) :: me
    type(simulation_t), intent(in)    :: sim
    real(dp), intent(out), optional :: Qext_Check

    real(dp) :: wwn
    real(dp) :: dx,cpMS,dcpMSdT,cpMSplus,VarcentreeS_i,VarcentreeS_iplus,DerVarcentreeS
    real(dp) :: B,St,Tc,Tc0,Bc,Bc0,Jc0,Jop,TcS
    integer :: i,ii,NbCells

      wwn = sim%dt/sim%dtPrev1
      me%big%amS=0.0_dp;me%big%bmS=0.0_dp;me%big%cmS=0.0_dp;me%big%bvS=0.0_dp

      NbCells=me%SC_Prop%NbCells

      do i=1,NbCells

        dx=me%SC_Prop%dxLoc(i)

        cpMS=0.0_dp
        dcpMSdT=0.0_dp
        cpMSplus=0.0_dp
        
        cpMS=cpMS+me%ct(STAB)%area*me%mat_stab%density*me%mat_stab%heat_capacity(me%StVar%SCtemp(i))
        dcpMSdT=dcpMSdT+me%ct(STAB)%area*me%mat_stab%density*me%mat_stab%heat_capacity_der(me%StVar%SCtemp(i))

        B   = me%scen%Bfield(i)
        St  = me%mat_supc%strain(B,me%scen%ElCur)
        TC  = me%mat_supc%critical_temperature(B,St)
        Tc0 = me%mat_supc%critical_temperature(0.0_dp,St)
        Bc  = me%mat_supc%critical_field(me%StVar%SCtemp(i),St)
        Bc0 = me%mat_supc%critical_field(0.0_dp,St)
        Jc0 = me%mat_supc%critical_current_density(0.0_dp,B,St,Tc0,Bc)
        Jop = abs(me%scen%ElCur)/me%ct(SUPC)%area
        TcS=me%mat_supc%current_sharing_temperature(B,St,Jop,Bc0,Jc0,Tc,Tc0,Bc)      
        cpMS=cpMS+me%ct(SUPC)%area*me%mat_supc%density*me%mat_supc%heat_capacity(me%StVar%SCtemp(i),B,TC,TcS,Tc0)
        dcpMSdT=dcpMSdT+me%ct(SUPC)%area*me%mat_supc%density*me%mat_supc%heat_capacity_der(me%StVar%SCtemp(i),B,TC,TcS,Tc0)

        if(i/=NbCells) then
          cpMSplus=cpMSplus+me%ct(STAB)%area*me%mat_stab%density*me%mat_stab%heat_capacity(me%StVar%SCtemp(i+1))
  
          B   = me%scen%Bfield(i+1)
          St  = me%mat_supc%strain(B,me%scen%ElCur)
          TC  = me%mat_supc%critical_temperature(B,St)
          Tc0 = me%mat_supc%critical_temperature(0.0_dp,St)
          Bc  = me%mat_supc%critical_field(me%StVar%SCtemp(i+1),St)
          Bc0 = me%mat_supc%critical_field(0.0_dp,St)
          Jc0 = me%mat_supc%critical_current_density(0.0_dp,B,St,Tc0,Bc)
          Jop = abs(me%scen%ElCur)/me%ct(SUPC)%area
          TcS=me%mat_supc%current_sharing_temperature(B,St,Jop,Bc0,Jc0,Tc,Tc0,Bc)      
          cpMSplus=cpMSplus+me%ct(SUPC)%area*me%mat_supc%density*me%mat_supc%heat_capacity(me%StVar%SCtemp(i+1),B,TC,TcS,Tc0)
        endif

        cpMS=cpMS/(me%ct(STAB)%area*me%mat_stab%density+me%ct(SUPC)%area*me%mat_supc%density)
        dcpMSdT=dcpMSdT/(me%ct(STAB)%area*me%mat_stab%density+me%ct(SUPC)%area*me%mat_supc%density)
        cpMSplus=cpMSplus/(me%ct(STAB)%area*me%mat_stab%density+me%ct(SUPC)%area*me%mat_supc%density)

        VarcentreeS_i=1.0_dp/(me%ro_M*cpMS)
        if(i/=NbCells) VarcentreeS_iplus=1.0_dp/(me%ro_M*cpMSplus)
        DerVarcentreeS=-dcpMSdT/(me%ro_M*cpMS*cpMS)

        if(i/=NbCells) me%big%amS(i)=me%big%amS(i)-(sim%dt/me%SC_Prop%dxLoc(i+1))*VarcentreeS_iplus*me%flxS%wire_DerdTL(i)
        me%big%bmS(i)=me%big%bmS(i)+1.0_dp-sim%dt/dx*(VarcentreeS_i*(me%flxS%wire_DerdTR(i-1)-me%flxS%wire_DerdTL(i))+&
                                                  (me%flxS%wire(i-1)-me%flxS%wire(i))*DerVarcentreeS)
        if(i/=NbCells) me%big%cmS(i)=me%big%cmS(i)+(sim%dt/dx)*VarcentreeS_i*me%flxS%wire_DerdTR(i)
        me%big%bvS(i)=me%big%bvS(i)-(sim%dt/dx)*VarcentreeS_i*(me%flxS%wire(i)-me%flxS%wire(i-1))

      enddo

      if(present(Qext_Check)) then
        call source_term_definition_strand(me,sim,Qext_Check)
      else
        call source_term_definition_strand(me,sim)
      endif

      do i=1,NbCells
        ! Modification of the diagonal terms
          me%big%bmS(i)=me%big%bmS(i)-1.0_dp+((1.0_dp+2.0_dp*wwn)/(1.0_dp+wwn))

        ! Modification of the vector B by adding time step n-1 contribution
          me%big%bvS(i)=me%big%bvS(i)+((wwn**2)/(1.0_dp+wwn))*(me%StVar%SCtemp(i)-me%StVarOld2%SCtemp(i))
      enddo

end subroutine full_physics_definition_strand