full_physics_definition_solid Subroutine

public subroutine full_physics_definition_solid(me, sim)

Arguments

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

Calls

proc~~full_physics_definition_solid~~CallsGraph proc~full_physics_definition_solid full_physics_definition_solid proc~material_heat_capacity material_t%material_heat_capacity proc~full_physics_definition_solid->proc~material_heat_capacity proc~material_heat_capacity_der material_t%material_heat_capacity_der proc~full_physics_definition_solid->proc~material_heat_capacity_der proc~source_term_definition_solid source_term_definition_solid proc~full_physics_definition_solid->proc~source_term_definition_solid proc~source_term_definition_solid->proc~material_heat_capacity proc~source_term_definition_solid->proc~material_heat_capacity_der proc~material_thermal_conductivity material_t%material_thermal_conductivity proc~source_term_definition_solid->proc~material_thermal_conductivity proc~material_thermal_conductivity_der material_t%material_thermal_conductivity_der proc~source_term_definition_solid->proc~material_thermal_conductivity_der

Called by

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

Source Code

subroutine full_physics_definition_solid(me,sim)
    type(solid_t),      intent(inout) :: me
    type(simulation_t), intent(in)    :: sim
    
    real(dp) :: wwn,ro_M,dx,cpMS,dcpMSdT,cpMSplus,VarcentreeS_i,VarcentreeS_iplus,DerVarcentreeS
    integer :: i,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%MC_Prop%NbCells

    if(me%MC_Prop%cond_btw_nodes) then
      do i=1,NbCells
        dx=me%MC_Prop%dxLoc(i)
         
        cpMS=me%mat%heat_capacity(me%StVar%MCtemp(i))
        dcpMSdT=me%mat%heat_capacity_der(me%StVar%MCtemp(i))
        if(i/=NbCells) then
          cpMSplus=me%mat%heat_capacity(me%StVar%MCtemp(i+1))
        endif
      
        ro_M=me%mat%density
        VarcentreeS_i=1.0_dp/(ro_M*cpMS)
        if(i/=NbCells) VarcentreeS_iplus=1.0_dp/(ro_M*cpMSplus)
        DerVarcentreeS=-dcpMSdT/(ro_M*cpMS*cpMS)
      
        if(i/=NbCells) me%big%amS(i)=me%big%amS(i)-(sim%dt/me%MC_Prop%dxLoc(i+1))*VarcentreeS_iplus*me%flxS%sd_DerdTL(i)
        me%big%bmS(i)=me%big%bmS(i)+1.0_dp-sim%dt/dx*(VarcentreeS_i*(me%flxS%sd_DerdTR(i-1)-me%flxS%sd_DerdTL(i))+&
                                                  (me%flxS%sd(i-1)-me%flxS%sd(i))*DerVarcentreeS)
        if(i/=NbCells) me%big%cmS(i)=me%big%cmS(i)+(sim%dt/dx)*VarcentreeS_i*me%flxS%sd_DerdTR(i)
        me%big%bvS(i)=me%big%bvS(i)-(sim%dt/dx)*VarcentreeS_i*(me%flxS%sd(i)-me%flxS%sd(i-1))
      enddo   
    else
      me%big%bmS(:)=1.0_dp
    endif 

    call source_term_definition_solid(me,sim)
    
    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%MCtemp(i)-me%StVarOld2%MCtemp(i))
    enddo

end subroutine full_physics_definition_solid