OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
alefvm_gravity.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| alefvm_gravity ../engine/source/ale/alefvm/alefvm_gravity.F
25!||--- called by ------------------------------------------------------
26!|| sforc3 ../engine/source/elements/solid/solide/sforc3.F
27!||--- uses -----------------------------------------------------
28!|| alefvm_mod ../common_source/modules/ale/alefvm_mod.f
29!|| element_mod ../common_source/modules/elements/element_mod.F90
30!||====================================================================
31 SUBROUTINE alefvm_gravity(VOLN, IXS, RHO)
32C-----------------------------------------------
33C D e s c r i p t i o n
34C-----------------------------------------------
35C 'alefvm' is related to a collocated scheme (built from FVM and based on Godunov scheme)
36C which was temporarily introduced for experimental option /INTER/TYPE22 (FSI coupling with cut cell method)
37C This cut cell method is not completed, abandoned, and is not an official option.
38C There is no other use for this scheme which is automatically enabled when /INTER/TYPE22 is defined (INT22>0 => IALEFVM=1).
39C
40C This subroutine is treating an uncut cell.
41C-----------------------------------------------
42C M o d u l e s
43C-----------------------------------------------
44 USE alefvm_mod
45 use element_mod , only : nixs
46C-----------------------------------------------
47C I m p l i c i t T y p e s
48C-----------------------------------------------
49#include "implicit_f.inc"
50C-----------------------------------------------
51C G l o b a l P a r a m e t e r s
52C-----------------------------------------------
53#include "mvsiz_p.inc"
54C-----------------------------------------------
55C C o m m o n B l o c k s
56C-----------------------------------------------
57#include "vect01_c.inc"
58#include "com01_c.inc"
59#include "param_c.inc"
60C-----------------------------------------------
61C D e s c r i p t i o n
62C-----------------------------------------------
63C This subroutines computes gravity forces for
64C finite volume scheme (IALEFVM==1)
65C-----------------------------------------------
66C D u m m y A r g u m e n t s
67C-----------------------------------------------
68 INTEGER :: IXS(NIXS,*)
69 my_real :: voln(mvsiz), rho(mvsiz)
70C-----------------------------------------------
71C L o c a l V a r i a b l e s
72C-----------------------------------------------
73 INTEGER :: I, J
74 INTEGER :: NVERTEX,INOd,II
75 my_real :: m_cell(mvsiz),accel(3,mvsiz)
76 LOGICAL :: debug_outp
77 INTEGER :: idbf,idbl
78C-----------------------------------------------
79C P r e - C o n d i t i o n s
80C-----------------------------------------------
81! IF(IALEFVM==0)RETURN
82! IF(NGRAV==0) RETURN !no there is Call_my barrier
83C-----------------------------------------------
84C S o u r c e L i n e s
85C-----------------------------------------------
86
87
88 !-------------------------------------------------------------!
89 ! GRAVITY COMPUTED FOR CELL CENTROIDS !
90 !-------------------------------------------------------------!
91 DO i=lft,llt
92 nvertex = 0
93 accel(1:3,i) = zero
94 !loop on vertexes
95 DO j=1,8
96 inod = ixs(1+j,i+nft)
97 IF(alefvm_buffer%VERTEX(4,inod)==zero) cycle
98 nvertex = nvertex + 1
99 accel(1,i) = accel(1,i) + alefvm_buffer%VERTEX(1,inod)
100 accel(2,i) = accel(2,i) + alefvm_buffer%VERTEX(2,inod)
101 accel(3,i) = accel(3,i) + alefvm_buffer%VERTEX(3,inod)
102 ENDDO
103 IF(nvertex>0)THEN
104 accel(1,i) = accel(1,i) / nvertex
105 accel(2,i) = accel(2,i) / nvertex
106 accel(3,i) = accel(3,i) / nvertex
107 ENDIF
108 enddo!next I
109
110 DO i=lft,llt
111 m_cell(i) = rho(i)*voln(i)
112 enddo!next I
113
114 DO i=lft,llt
115 ii = i + nft
116 alefvm_buffer%FCELL(1,ii) = alefvm_buffer%FCELL(1,ii) + m_cell(i) * accel(1,i)
117 alefvm_buffer%FCELL(2,ii) = alefvm_buffer%FCELL(2,ii) + m_cell(i) * accel(2,i)
118 alefvm_buffer%FCELL(3,ii) = alefvm_buffer%FCELL(3,ii) + m_cell(i) * accel(3,i)
119 enddo!next I
120
121 !DEBUG-OUTPUT---------------!
122 if(alefvm_param%IOUTP_GRAV /= 0)then
123 debug_outp = .false.
124 if(alefvm_param%IOUTP_GRAV>0)then
125 do i=lft,llt
126 ii = nft + i
127 if(ixs(11,ii)==alefvm_param%IOUTP_GRAV)THEN
128 debug_outp = .true.
129 idbf = i
130 idbl = i
131 EXIT
132 endif
133 enddo
134 elseif(alefvm_param%IOUTP_GRAV==-1)then
135 debug_outp=.true.
136 idbf = lft
137 idbl = llt
138 endif
139!#!include "lockon.inc"
140 if(debug_outp)then
141!#!include "lockon.inc"
142 print *, " |----alefvm_gravity.F----|"
143 print *, " | THREAD INFORMATION |"
144 print *, " |------------------------|"
145 print *, " NCYCLE =", ncycle
146 do i=idbf,idbl
147 ii = nft + i
148 print *, " brique=", ixs(11,nft+i)
149 write(*,fmt='(A24,1A26)') " ",
150 . "#--------- cell----------#"
151 write (*,fmt='(A,1E26.14)') " Rho =", rho(i)
152 write (*,fmt='(A,1E26.14)') " Vol =", voln(i)
153 write (*,fmt='(A,1E26.14)') " Mass =", m_cell(i)
154 write (*,fmt='(A,1E26.14)') " Accel-X =", accel(1,i)
155 write (*,fmt='(A,1E26.14)') " Accel-Y =", accel(2,i)
156 write (*,fmt='(A,1E26.14)') " Accel-Z =", accel(3,i)
157 write(*,fmt='(A24,8A26)') " ",
158 . "#--------- nod_1 ---------","#--------- nod_2 ---------",
159 . "#--------- nod_3 ---------","#--------- nod_4 ---------",
160 . "#--------- nod_5 ---------","#--------- nod_6 ---------",
161 . "#--------- nod_7 ---------","#--------- nod_8 --------#"
162 write (*,fmt='(A,8E26.14)') " acc-X =", alefvm_buffer%VERTEX(1,ixs(2:9,i))
163 write (*,fmt='(A,8E26.14)') " acc-Y =", alefvm_buffer%VERTEX(2,ixs(2:9,i))
164 write (*,fmt='(A,8E26.14)') " acc-Z =", alefvm_buffer%VERTEX(3,ixs(2:9,i))
165 print *, " "
166 enddo
167!#!include "lockoff.inc"
168 endif
169 endif
170 !-----------------------------------------!
171
172 RETURN
173 END
subroutine alefvm_gravity(voln, ixs, rho)
#define my_real
Definition cppsort.cpp:32
type(alefvm_buffer_), target alefvm_buffer
Definition alefvm_mod.F:120
type(alefvm_param_), target alefvm_param
Definition alefvm_mod.F:121