full_physics_definition_mesh2D Subroutine

public subroutine full_physics_definition_mesh2D(me, sim, Qext_Check_case_loc)

Arguments

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

Calls

proc~~full_physics_definition_mesh2d~~CallsGraph proc~full_physics_definition_mesh2d full_physics_definition_mesh2D proc~material_heat_capacity material_t%material_heat_capacity proc~full_physics_definition_mesh2d->proc~material_heat_capacity proc~material_heat_capacity_der material_t%material_heat_capacity_der proc~full_physics_definition_mesh2d->proc~material_heat_capacity_der proc~signal_v0d signal_t%signal_v0d proc~full_physics_definition_mesh2d->proc~signal_v0d proc~signal_v1d signal_t%signal_v1d proc~signal_v0d->proc~signal_v1d

Called by

proc~~full_physics_definition_mesh2d~~CalledByGraph proc~full_physics_definition_mesh2d full_physics_definition_mesh2D proc~main_loop main_loop proc~main_loop->proc~full_physics_definition_mesh2d program~reims_p reims_p program~reims_p->proc~main_loop

Source Code

subroutine full_physics_definition_mesh2D(me,sim,Qext_Check_case_loc)
    type(mesh2D_t),     intent(inout) :: me
    type(simulation_t), intent(in)    :: sim
    real(dp), intent(out), optional :: Qext_Check_case_loc

    real(dp) :: wwn
    real(dp) :: ro,cp,dcpdT,VarcentS,DerVarcentS,dt_Vi,Q_case_sum
    integer  :: nb_e, NbCells, jj, i
  
      wwn = sim%dt/sim%dtPrev1
      me%big%bmx=0.0_dp;me%big%bvx=0.0_dp;me%big%dmx=0.0_dp

      NbCells=me%M2D_Prop%nb_elements

      do nb_e=1,NbCells
        do i = 1, size(me%label%regionArr)
            if(trim(me%M2D_Prop%elem(nb_e)%PhysE)==trim(me%label%regionArr(i)%id)) then
                cp=me%label%regionArr(i)%mat%heat_capacity(me%StVar%temp(nb_e))
                dcpdT=me%label%regionArr(i)%mat%heat_capacity_der(me%StVar%temp(nb_e))
                ro=me%label%regionArr(i)%mat%density
                Q_case_sum = me%label%regionArr(i)%value%v0d()/(me%label%regionArr(i)%SurfaceRegion*me%extrusion_length)
                exit
            endif
        enddo

        VarcentS=1.0_dp/(ro*cp)
        DerVarcentS=-dcpdT/(ro*cp*cp)

        dt_Vi=sim%dt/me%M2D_Prop%elem(nb_e)%surface

        me%big%bmx(nb_e)=1.0_dp+dt_Vi*DerVarcentS*me%flxS%SomNormQT(nb_e)+dt_Vi*VarcentS*me%flxS%DerSomNormQT(nb_e)
           
        me%big%bvx(nb_e)=-dt_Vi*VarcentS*me%flxS%SomNormQT(nb_e)
        
        do jj=1,3
          me%big%dmx(nb_e,jj)=dt_Vi*VarcentS*me%flxS%DerNormQTOth2D(nb_e,jj)
        enddo

        ! Source terms
        me%big%bmx(nb_e) = me%big%bmx(nb_e) - sim%dt * DerVarcentS * Q_case_sum
        me%big%bvx(nb_e) = me%big%bvx(nb_e) + sim%dt * VarcentS    * Q_case_sum

        ! if(present(Qext_Check_case_loc) .and. trim(me%M2D_Prop%elem(nb_e)%PhysE)=='SS_Outer') then
        !   Qext_Check_case_loc = Q_case_sum * sim%dt
        ! endif
      enddo
    
      if(.not.sim%explicit) then
        do nb_e=1,NbCells
          ! Modification of the diagonal terms 
            me%big%bmx(nb_e)=me%big%bmx(nb_e)-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%bvx(nb_e)=me%big%bvx(nb_e)+((wwn**2)/(1.0_dp+wwn))*(me%StVar%temp(nb_e)-me%StVarOld2%temp(nb_e))
        enddo
      endif

end subroutine full_physics_definition_mesh2D