Fluid port initialisation for solids
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solid_t), | intent(inout), | target | :: | me | ||
| type(krn_t), | intent(inout) | :: | krn | |||
| class(input_t), | intent(in), | pointer | :: | cfg |
subroutine solid_init_part2(me, krn, cfg) !! Fluid port initialisation for solids type(solid_t), target, intent(inout) :: me type(krn_t), intent(inout) :: krn class(input_t), pointer, intent(in) :: cfg integer :: NbSubM,i,idx,PrevRowIdx,PrevColIdx,j real(dp), pointer :: rhs(:) integer, allocatable :: list_thp_loc(:),list_thS_loc(:) type(FS_port_t), pointer :: FS_ports(:) type(SS_src_port_t), pointer :: SS_src_ports(:) call krn%update(rhs_or_solution_view=rhs) me%big%bvS(1:me%MC_Prop%NbCells) => rhs if(me%MC_Prop%nb_FS_ports>0) then allocate(list_thp_loc(me%MC_Prop%nb_FS_ports),me%MC_Prop%thermP(me%MC_Prop%nb_FS_ports)) list_thp_loc = pack([(i, i=1, me%MC_Prop%NbCells)], me%MC_Prop%FSlink) call krn%update(FS_p_loc=list_thp_loc,CompName=cfg%str('id'),FS_p_view=FS_ports) j=1 do i=1,me%MC_Prop%NbCells if(me%MC_Prop%FSlink(i)) then me%MC_Prop%idxFSlk(i)=j me%MC_Prop%thermP(j)%p => FS_ports(j) me%MC_Prop%thermP(j)%p%typeS = 'solid' me%MC_Prop%thermP(j)%p%rhoMS = me%mat%density me%MC_Prop%thermP(j)%p%VolMS = me%MC_Prop%volLoc(i) j=j+1 endif enddo endif if(me%MC_Prop%SSsrcLink) then allocate(list_thS_loc(me%MC_Prop%NbCells),me%MC_Prop%thermS(me%MC_Prop%NbCells)) list_thS_loc=[(i,i=1,me%MC_Prop%NbCells)] call krn%update(SS_src_p_loc=list_thS_loc,SS_src_p_view=SS_src_ports) do i=1,me%MC_Prop%NbCells me%MC_Prop%thermS(i)%p => SS_src_ports(i) me%MC_Prop%thermS(i)%p%typeS = 'solid' me%MC_Prop%thermS(i)%p%rhoS = me%mat%density me%MC_Prop%thermS(i)%p%VolS = me%MC_Prop%volLoc(i) me%MC_Prop%thermS(i)%p%Height = me%MC_Prop%dxLoc(i) enddo endif NbSubM=me%MC_Prop%NbCells allocate(me%bigLS%ValExp(NbSubM),me%bigLS%RowExp(NbSubM),me%bigLS%ColExp(NbSubM)) if(me%MC_Prop%cond_btw_nodes) then NbSubM=2*2+(me%MC_Prop%NbCells-2)*3 else NbSubM=me%MC_Prop%NbCells endif allocate(me%bigLS%ValImp(NbSubM),me%bigLS%RowImp(NbSubM),me%bigLS%ColImp(NbSubM)) idx=1 PrevColIdx=0 PrevRowIdx=0 do i=1,me%MC_Prop%NbCells me%bigLS%ValExp(idx)%p => me%big%bmS(i) me%bigLS%ColExp(idx)=PrevColIdx+1 me%bigLS%RowExp(idx)=PrevRowIdx+1 me%bigLS%ValImp(idx)%p => me%big%bmS(i) me%bigLS%ColImp(idx)=PrevColIdx+1 me%bigLS%RowImp(idx)=PrevRowIdx+1 idx=idx+1 PrevColIdx=PrevColIdx+1 PrevRowIdx=PrevRowIdx+1 enddo call krn%coo_add(.true.,me%bigLS%ColExp,me%bigLS%RowExp,me%bigLS%ValExp) if(me%MC_Prop%cond_btw_nodes) then PrevColIdx=1 PrevRowIdx=0 do i=1,me%MC_Prop%NbCells-1 me%bigLS%ValImp(idx)%p => me%big%cmS(i) me%bigLS%ColImp(idx)=PrevColIdx+1 me%bigLS%RowImp(idx)=PrevRowIdx+1 idx=idx+1 PrevColIdx=PrevColIdx+1 PrevRowIdx=PrevRowIdx+1 enddo PrevColIdx=0 PrevRowIdx=1 do i=1,me%MC_Prop%NbCells-1 me%bigLS%ValImp(idx)%p => me%big%amS(i) me%bigLS%ColImp(idx)=PrevColIdx+1 me%bigLS%RowImp(idx)=PrevRowIdx+1 idx=idx+1 PrevColIdx=PrevColIdx+1 PrevRowIdx=PrevRowIdx+1 enddo endif call krn%coo_add(.false.,me%bigLS%ColImp,me%bigLS%RowImp,me%bigLS%ValImp) deallocate(me%bigLS%ValExp,me%bigLS%RowExp,me%bigLS%ColExp) deallocate(me%bigLS%ValImp,me%bigLS%RowImp,me%bigLS%ColImp) end subroutine solid_init_part2