OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
h3d_velvecc22.F File Reference
#include "implicit_f.inc"
#include "com01_c.inc"
#include "com04_c.inc"
#include "param_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine h3d_velvecc22 (elbuf_tab, iparg, iflg, ixs, ixq, itab, iok_part, is_written_node, nodal_vector)

Function/Subroutine Documentation

◆ h3d_velvecc22()

subroutine h3d_velvecc22 ( type (elbuf_struct_), dimension(ngroup), target elbuf_tab,
integer, dimension(nparg,*), intent(in) iparg,
integer, intent(in) iflg,
integer, dimension(nixs,numels), intent(in) ixs,
integer, dimension(nixq,numelq), intent(in) ixq,
integer, dimension(numnod), intent(in) itab,
integer, dimension(*), intent(in) iok_part,
integer, dimension(*), intent(inout) is_written_node,
dimension(3,*), intent(inout) nodal_vector )

Definition at line 36 of file h3d_velvecc22.F.

38C-----------------------------------------------
39C D e s c r i p t i o n
40C-----------------------------------------------
41C This subroutines writes at polyedra centroids :
42C velocities (IFLG=1),
43C momentum density (IFLG=2)
44C internal forces (IFLG=3),
45C for coupling interface 22. Free nodes are used
46C as marker to plot centroid vectors
47C(see input card for grnod_id)
48C-----------------------------------------------
49C M o d u l e s
50C-----------------------------------------------
51 USE initbuf_mod
52 USE elbufdef_mod
54 USE i22edge_mod
55 USE i22tri_mod
56C-----------------------------------------------
57C I m p l i c i t T y p e s
58C-----------------------------------------------
59#include "implicit_f.inc"
60C-----------------------------------------------
61C C o m m o n B l o c k s
62C-----------------------------------------------
63#include "com01_c.inc"
64#include "com04_c.inc"
65#include "param_c.inc"
66C-----------------------------------------------
67C D u m m y A r g u m e n t s
68C-----------------------------------------------
69 INTEGER, INTENT(IN) :: IPARG(NPARG,*), IFLG,IXS(NIXS,NUMELS),IXQ(NIXQ,NUMELQ),ITAB(NUMNOD)
70 INTEGER, INTENT(IN) :: IOK_PART(*)
71 INTEGER, INTENT(INOUT) :: IS_WRITTEN_NODE(*)
72 my_real, INTENT(INOUT) :: nodal_vector(3,*)
73 REAL R4
74 TYPE (ELBUF_STRUCT_), DIMENSION(NGROUP), TARGET :: ELBUF_TAB
75 TYPE(BUF_MAT_),POINTER :: MBUF
76 TYPE(G_BUFEL_),POINTER :: GBUF
77C-----------------------------------------------
78C L o c a l A r g u m e n t s
79C-----------------------------------------------
80 INTEGER :: NGM, IDLOCM, IBM,ICELLM,MLW,NCELL,NELm,NBF,NBL,ICELL,NIN,NODE_ID,IB,NG,I
81 my_real :: rho_cell, rho(4), vfrac(4)
82 REAL,DIMENSION(:,:),ALLOCATABLE :: BUFFER
83 my_real value(3)
84C-----------------------------------------------
85
86 !---------------------------------------------------------!
87 nbf = 1
88 nbl = nb
89 nin = 1
90 !---------------------------------------------------------!
91 ALLOCATE(buffer(3,numnod))
92 buffer(:,:) = zero
93
94 DO ib=nbf,nbl
95 icell = 0
96 ncell = brick_list(nin,ib)%NBCUT
97 DO WHILE (icell<=ncell) ! loop on polyhedron {1:NCELL} U {9}
98 icell = icell +1
99 IF (icell>ncell .AND. ncell/=0)icell=9
100 ibm = brick_list(nin,ib)%POLY(icell)%WhereIsMain(4)
101 icellm = brick_list(nin,ibm)%mainID
102 IF(ibm==0)THEN
103 ibm = ib
104 icellm = 1
105 ENDIF
106 ngm = brick_list(nin,ibm)%NG
107 idlocm = brick_list(nin,ibm)%IDLOC
108 gbuf =>elbuf_tab(ngm)%GBUF
109 mbuf =>elbuf_tab(ngm)%BUFLY(1)%MAT(1,1,1)
110 nelm = iparg(2,ngm)
111 mlw = iparg(1,ngm)
112 IF(mlw==37)THEN
113 !UVAR(I,1) : massic percentage of liquid * global density (rho1*V1/V : it needs to give liquid mass multiplying by element volume in aleconve.F)
114 !UVAR(I,2) : density of gas
115 !UVAR(I,3) : density of liquid
116 !UVAR(I,4) : volumetric fraction of liquid
117 !UVAR(I,5) : volumetric fraction of gas
118 rho(1) = mbuf%VAR((3-1)*nelm+idlocm)
119 rho(2) = mbuf%VAR((2-1)*nelm+idlocm)
120 vfrac(1) = mbuf%VAR((4-1)*nelm+idlocm)
121 vfrac(2) = mbuf%VAR((5-1)*nelm+idlocm)
122 rho_cell = rho(1)*vfrac(1) + rho(2)*vfrac(2)
123 ELSEIF(mlw==51)THEN
124 rho(1) = zero
125 rho(2) = zero
126 rho_cell = zero
127 ELSE
128 rho_cell = gbuf%RHO(idlocm)
129 ENDIF
130 node_id = brick_list(nin,ib)%POLY(icell)%ID_FREE_NODE
131 IF(node_id<=0)cycle ! not enough nodes in the group or SMP disabling
132 IF(iflg==1)THEN
133 !velocity vector : U
134 buffer(1,node_id) = gbuf%MOM(nelm*(1-1) + idlocm) / rho_cell
135 buffer(2,node_id) = gbuf%MOM(nelm*(2-1) + idlocm) / rho_cell
136 buffer(3,node_id) = gbuf%MOM(nelm*(3-1) + idlocm) / rho_cell
137 ELSEIF(iflg==2)THEN
138 !momentum density vector : rho.U
139 buffer(1,node_id) = gbuf%MOM(nelm*(1-1) + idlocm)
140 buffer(2,node_id) = gbuf%MOM(nelm*(2-1) + idlocm)
141 buffer(3,node_id) = gbuf%MOM(nelm*(3-1) + idlocm)
142 ELSEIF(iflg==3)THEN
143 !internal force at centroid = sum(integral(P.dS))
144 buffer(1,node_id) = brick_list(nin,ibm)%FCELL(1)
145 buffer(2,node_id) = brick_list(nin,ibm)%FCELL(2)
146 buffer(3,node_id) = brick_list(nin,ibm)%FCELL(3)
147 ELSE
148 buffer(1,node_id) = zero
149 buffer(2,node_id) = zero
150 buffer(3,node_id) = zero
151 ENDIF
152 ENDDO !next ICELL
153 enddo!next IB
154
155 DO i=1,numnod
156 value(1)=buffer(1,i)
157 value(2)=buffer(2,i)
158 value(3)=buffer(3,i)
159 CALL h3d_write_vector(iok_part,is_written_node,nodal_vector,i,0,0,
160 . VALUE)
161 ENDDO
162
163 DEALLOCATE(buffer)
164 !---------------------------------------------------------!
165
166 RETURN
#define my_real
Definition cppsort.cpp:32
subroutine h3d_write_vector(iok_part, is_written, vector, i, offset, nft, value)
type(brick_entity), dimension(:,:), allocatable, target brick_list